A round of SS13 on tgstation13 had to be forced to end due to a rather unique bug. During the round the game started to continuously output "Cleanbot (a number)" and a small icon of the cleanbot mob, this is intended behaviour if a:
world << obj
statement is given, however we don't do this usually (except upon examining) and it certainly doesn't happen continuously. At the same time as this occuring, the vast majority of the game's sound effects stopped working, we use the sound() proc to output sounds. looking into the runtime logs showed that cleanbot/New() had been called constantly, but with the arguments for the sound() proc!
Byond had gotten confused and swapped sound() with /mob/living/simple_animal/bot/cleanbot/New()
The round had to be ended due to this bug causing over 6000 cleanbot mobs to be created, which brought the game to a crawl.
This bug has never happened to us before, and only resembles one other bug, the one where invalid procs provided to call()() attempt to call the first available proc, which for that bug is world/New()
(Runtime output and some more information available in the issue report on our github)
Numbered Steps to Reproduce Problem:
N/A, we have no idea how this happened, and it hasn't reproduced yet.
All we know is that sound() calls were replaced with calls to cleanbot/New()
Code Snippet (if applicable) to Reproduce Problem:
N/A, but one of the snippits that caused it were:
Runtime:
Undefined variable /mob/living/simple_animal/bot/cleanbot/var/wait
proc name: playsound local (/atom/proc/playsound_local)
source file: sound.dm,27
usr: (src)
src: Maline Trell (/mob/living/carbon/human)
src.loc: the floor (90,146,1) (/turf/simulated/floor/plasteel)
call stack:
Maline Trell (/mob/living/carbon/human): playsound local(the floor (90,147,1) (/turf/simulated/floor/plasteel), 'sound/items/Screwdriver.ogg', 50, 1, 42685, null, 1)
Maline Trell (/mob/living/carbon/human): playsound local(the floor (90,147,1) (/turf/simulated/floor/plasteel), 'sound/items/Screwdriver.ogg', 50, 1, 42685, null, 1)
playsound(the floor (90,147,1) (/turf/simulated/floor/plasteel), 'sound/items/Screwdriver.ogg', 50, 1, null, null, 1)
the security camera (/obj/machinery/camera): attackby(the screwdriver (/obj/item/weapon/screwdriver), Maline Trell (/mob/living/carbon/human), "icon-x=7;icon-y=27;left=1;scre...")
Maline Trell (/mob/living/carbon/human): ClickOn(the security camera (/obj/machinery/camera), "icon-x=7;icon-y=27;left=1;scre...")
the security camera (/obj/machinery/camera): Click(the floor (90,147,1) (/turf/simulated/floor/plasteel), "mapwindow.map", "icon-x=7;icon-y=27;left=1;scre...")
Where the relevant code in that runtime's case is:
/atom/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, surround = 1)
soundin = get_sfx(soundin)
var/sound/S = sound(soundin)
S.wait = 0 //No queue
S.channel = 0 //Any channel
S.volume = vol
Many more similar instances where mob/living/simple_animal/bot/cleanbot/New() was used instead of sound() call.
outputting of the bot's names and icons comes specifically from:
world << sound(...)
with sound obviously being replaced with the result of the cleanbot/New() call, which is of course a cleanbot mob, this bit is technically intended as DM simply outputted the mob as if it had been told to normally.
Expected Results:
sound() calls to function as sound() calls
Actual Results:
sound() calls were replaced with /mob/living/simple_animal/bot/cleanbot/New(), resulting in 6000+ cleanbot mobs, and almost all sound effects not playing.
Does the problem occur:
Every time? Or how often? It has occurred once so far
In other games? It has only occurred in SS13 so far
In other user accounts? Everyone connected to the server noticed the issue
On other computers? It has only occurred on the tgstation13 SS13 server computer so far
When does the problem NOT occur?
Every other round that has ever happened except for this one.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
The problem did not occur in any version below 509, but the bug does not always occur on 509 either (with this case being the first instance)
Workarounds:
None.
How ever world << sound happens often enough.