ID:1644985
 
BYOND Version:506
Operating System:Linux
Web Browser:Chrome 36.0.1985.125
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

A picture holds 1000 words. The servers with 14 - 15% CPU are stuck. I have to run kill -1 on them to shut them down. The reason why they don't go to 100% is because I limit their CPU for this very reason. Running SIGUSR1 (reboot) or 2 (diagnostic) does not work and SIGSEGV doesn't even shut it down, let alone give a report. Runing SIGHUP is the only option, apparently. Regardless, I couldn't get a single report on the matter after trying to investigate it for 3 days so far.


Numbered Steps to Reproduce Problem:
Run a game in threaded mode.


Expected Results:
It shouldn't hit their CPU limit.


Actual Results:
It hits their CPU limit.

Does the problem occur:

-Every time? Or how often? No set time, it seems. I don't keep an eye on them 24/7 but I do check it daily and everyday I see at least one that has this issue that is only in threaded mode.

-In other games? Yes, of course.

-In other user accounts? Linux. No such thing. Haha.

-On other computers? It never happened on my previous server. But, that was because I never upgraded to the latest version of BYOND. I was previously on 506.1245 and everything was easy peezy lemon squeezy.

When does the problem NOT occur?
When games don't run in threaded mode, which I will now force to happen. However, I can't say for sure that it's only threaded games that do this. After all, I haven't done thorough experimentation.


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.)
506.1245 (I never touched .1246 by the way)


Workarounds:
Run the game in threads off.
You have threads on AND map threads on, right?

Have you tried it without map-threads?
Nope.
I had this issue too if i had map-threads enabled the CPU would sit at 100% for no reason turn it off and its fine.

also it would normalize if a player joined but if it was empty with map threads 100%.
I got a successful backtrace, finally.

Sun Aug  3 12:05:28 2014
World opened on network port 6655.
Welcome BYOND! (5.0 Beta Version 506.1247)
The BYOND hub reports that port 6655 is reachable.
runtime error: list index out of bounds
proc name: move (/mob/monster/proc/move)
source file: Monsters.dm,264
usr: Bat (/mob/monster/Bat)
src: Bat (/mob/monster/Bat)
call stack:
Bat (/mob/monster/Bat): move()
Bat (/mob/monster/Bat): New(the dungeonsurface (222,19,2) (/turf/dungeonsurface))
runtime error: list index out of bounds
proc name: move (/mob/monster/proc/move)
source file: Monsters.dm,264
usr: Mummy (/mob/monster/Mummy)
src: Mummy (/mob/monster/Mummy)
call stack:
Mummy (/mob/monster/Mummy): move()
Mummy (/mob/monster/Mummy): New(the sand (149,31,2) (/turf/sand))
Sun Aug 3 15:56:33 2014
runtime error: bad client
proc name: UpdateLabels (/mob/proc/UpdateLabels)
source file: HUD.dm,9
usr: Kizo (/mob/player)
src: Kizo (/mob/player)
call stack:
Kizo (/mob/player): UpdateLabels()
Kizo (/mob/player): UpdateLabels()
runtime error: list index out of bounds
proc name: move (/mob/monster/proc/move)
source file: Monsters.dm,264
usr: Cockroach (/mob/monster/Cockroach)
src: Cockroach (/mob/monster/Cockroach)
call stack:
Cockroach (/mob/monster/Cockroach): move()
Cockroach (/mob/monster/Cockroach): New(the dungeonsurface (152,16,2) (/turf/dungeonsurface))
Mon Aug 4 01:35:23 2014
runtime error: list index out of bounds
proc name: move (/mob/monster/proc/move)
source file: Monsters.dm,264
usr: Snake (/mob/monster/Snake)
src: Snake (/mob/monster/Snake)
call stack:
Snake (/mob/monster/Snake): move()
Snake (/mob/monster/Snake): Fight(Archaeologist Todd (/mob/NPC/Archaeologist_Todd))
Snake (/mob/monster/Snake): Bump(Archaeologist Todd (/mob/NPC/Archaeologist_Todd))
Sun Aug 10 12:45:46 2014
World opened on network port 6655.
Welcome BYOND! (5.0 Beta Version 506.1247)
The BYOND hub reports that port 6655 is reachable.
Sun Aug 10 19:21:32 2014
runtime error: list index out of bounds
proc name: move (/mob/monster/proc/move)
source file: Monsters.dm,264
usr: Evil Rabbit (/mob/monster/Evil_Rabbit)
src: Evil Rabbit (/mob/monster/Evil_Rabbit)
call stack:
Evil Rabbit (/mob/monster/Evil_Rabbit): move()
Evil Rabbit (/mob/monster/Evil_Rabbit): Fight(Smith (/mob/NPC/Smith))
Evil Rabbit (/mob/monster/Evil_Rabbit): Bump(Smith (/mob/NPC/Smith))
Mon Aug 11 00:51:03 2014
runtime error: list index out of bounds
proc name: move (/mob/monster/proc/move)
source file: Monsters.dm,264
usr: Black Bear (/mob/monster/Black_Bear)
src: Black Bear (/mob/monster/Black_Bear)
call stack:
Black Bear (/mob/monster/Black_Bear): move()
Black Bear (/mob/monster/Black_Bear): Fight(Villager (/mob/NPC/Villager))
Black Bear (/mob/monster/Black_Bear): Bump(Villager (/mob/NPC/Villager))
BUG: Crashing due to an illegal operation!
proc name: move (/mob/monster/proc/move)
source file: Monsters.dm,250
usr: Evil Rabbit (/mob/monster/Evil_Rabbit)
src: Evil Rabbit (/mob/monster/Evil_Rabbit)
call stack:
Evil Rabbit (/mob/monster/Evil_Rabbit): move()
Evil Rabbit (/mob/monster/Evil_Rabbit): Fight(Tommy (/mob/NPC/Tommy))
Evil Rabbit (/mob/monster/Evil_Rabbit): Bump(Tommy (/mob/NPC/Tommy))

Backtrace for BYOND 506.1247 on Linux:
Generated at Mon Aug 11 01:40:33 2014

DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804bb14]
libbyond.so [0xb7254000, 0x0], 0x1fdec8
[0xb7715000, 0xb7715600], [0xb7715000, 0xb7715600]
libbyond.so [0xb7254000, 0x0], 0x1fdec8
libbyond.so [0xb7254000, 0x0], 0x20c305
libbyond.so [0xb7254000, 0x0], 0x204fff
libbyond.so [0xb7254000, 0x0], 0x204fff
libbyond.so [0xb7254000, 0x0], 0x21dccc
libbyond.so [0xb7254000, 0x0], 0x21f465
libbyond.so [0xb7254000, 0x0], 0x1e7683
libbyond.so 0x2bb1d0, 0x2bb31a
libbyond.so 0x28a730, 0x28a932
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804aed4]
libc.so.6 0x16c40, 0x16d26 (__libc_start_main)
DreamDaemon [0x8048000, 0x0], [0x8048000, 0x804a771]

Recent proc calls:
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/Bump
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move
/mob/monster/proc/move

To help the BYOND developers debug this, please send the above trace as part
of a very detailed bug report: http://www.byond.com/members/?command=view_tracker&tracker=1
That looks like an issue in the game's code more than anything wrong with BYOND.
In response to Mloc
Mloc wrote:
That looks like an issue in the game's code more than anything wrong with BYOND.

Yes, because 10 other games don't matter. *sarcasm*

There are multiple games involved. Not just 1 game.
Threading is horribly, horribly broken on Linux. It'd be a miracle if I could even start my (SS13) server on it, if it doesn't crash during the game, or at the game's ending.

I suggest not using it, at least not until someone picks the work back up and makes it an useful, non-broken addition to BYOND..

Beside this, Mloc seems to have a point, all of your errors that eventually result in a crash seem to be game-related.. (And not CPU related)
I would advise disabling threading until we return to it. The web server protocol fortunately is much more accommodating to a multithreading implementation, so we'll resume there after it's in beta.
I disabled it. Just wanted everyone to be aware of the issue. Nobody can enable it when they start up a server.