smcameron / space-nerds-in-space

Multi-player spaceship bridge simulator game. Captain your starship through adventures with your friends. See https://smcameron.github.io/space-nerds-in-space
GNU General Public License v2.0
724 stars 73 forks source link

Caught snis_client using 100% CPU #326

Open smcameron opened 1 year ago

smcameron commented 1 year ago

Was using Ctrl-X to put the camera outside the ship in "free mode" (hit space 2x after Ctrl-x), and noticed the controls becoming a bit sluggish, which was weird. Switched to another window for a bit, and after awhile noticed the laptop fan winding up. Switched back to snis_client, and controls were unresponsive. Tried to kill (with SIGTERM) all the SNIS processes, but snis_client would not die. Had to use kill -9 to put it down. I suppose I suspect something about the Ctrl-X functionality, but, doesn't really make sense, all that does is move the camera, iirc.

smcameron commented 1 year ago

Noticed in snis_client_log.txt, lots of lines like:

Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68
Out of entities at entity.c:68

And in snis_server_log.txt, lots of these:

snis_server(zaurno): BUG detected at snis_server.c:snis_queue_delete_object_helper:2000, o->id == -1, o->type = 1
snis_server(zaurno): BUG detected at snis_server.c:snis_queue_delete_object_helper:2000, o->id == -1, o->type = 1
snis_server(zaurno): BUG detected at snis_server.c:snis_queue_delete_object_helper:2000, o->id == -1, o->type = 1

Also, in case it make some difference, I was running unstripped, unoptimized binaries (compiled with "make O=0").

smcameron commented 1 year ago

I don't think that the messages about "snis_queue_delete_object_helper... o->id == -1" are relevant to this bug. That was tracked down and fixed, see #157 for more info on that.