Crash when spawning on top of a bear
Found while testing Chard's server which spawns a bear if you pick milkweed at the wrong time:
Stacktrace:
#0 0x0000000000457528 in LivingLifePage::step (this=0x30a4560) at LivingLifePage.cpp:9882
#1 0x00000000004344ec in PageComponent::base_step (this=0x30a4560) at PageComponent.cpp:54
#2 0x00000000004367ad in GamePage::base_step (this=0x30a4560) at GamePage.cpp:334
#3 0x0000000000406f9e in drawFrame (inUpdate=1 '\001') at game.cpp:1234
#4 0x00000000004ee8fa in GameSceneHandler::drawScene (this=0x9a3e40) at ../../minorGems/game/platforms/SDL/gameSDL.cpp:3044
#5 0x00000000004bb5df in callbackDisplay () at ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2766
#6 0x00000000004b9f8f in ScreenGL::start (this=0x7f1e70) at ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2007
#7 0x00000000004ed5de in mainFunction (inNumArgs=1, inArgs=0x7fffffffdc98) at ../../minorGems/game/platforms/SDL/gameSDL.cpp:2472
#8 0x00000000004e8bf6 in main (inArgCount=1, inArgs=0x7fffffffdc98) at ../../minorGems/game/platforms/SDL/gameSDL.cpp:23
LivingLifePage.cpp:9882 for me is:
ourID = ourObject->id;
The client crashes when it gets the first player update, which looks to be empty:
Got length 3 message
PU
Server log:
Got connection
Listening for another connection on port 8005
Got new player logged in
Placing new Eve: Found an existing camp at (1714.310102,13302.689898) with 3 placements and 0.756388 max radius
Placing new Eve: trying radius of 104 from camp
New player ***** connected as player 63
Object moving from (1710,13307) to (1714,13303)
Compressed 328 bytes down to 108
Object moving from (1718,13291) to (1722,13287)
Compressed 5865 bytes down to 236
Logging Eve death: Eve died too young (age=14.033450, min=60.000000), not remembering her camp, and clearing any old camp memory
Compressed 1736 bytes down to 385
Object moving from (1722,13287) to (1724,13285)
Got connection
Listening for another connection on port 8005
Got new player logged in
Placing new Eve: Found an existing camp at (1714.000000,13303.000000) with 1 placements and 0.000000 max radius
Placing new Eve: trying radius of 104 from camp
New player ***** connected as player 64
Compressed 5865 bytes down to 236
Logging Eve death: Eve died too young (age=14.016750, min=60.000000), not remembering her camp, and clearing any old camp memory
Object moving from (1724,13285) to (1720,13289)
Closing connection to player 63 on error (cause: Socket write failed)
1 remaining player(s) alive on server
Object moving from (1714,13303) to (1718,13303)
Object moving from (1720,13289) to (1725,13294)
Closing connection to player 64 on error (cause: Player killed by permanent object)
0 remaining player(s) alive on server
Object moving from (1718,13303) to (1723,13303)
Object moving from (1723,13303) to (1719,13299)
I also managed to reproduce it myself. Server was slightly modified to override biome and natural object.
Can someone post the stdout dump from the client before the crash? I want to see this empty PU message. Also, a short recorded game from the client crash would be great.
The empty PU message itself is above, here's the full client stdout (after some frame rate spam):
Decompressing took 0.000000 seconds
Loaded 708 tagged sprites from sprites folder
Loaded 197 sound IDs from sounds folder
Decompressing took 0.007000 seconds
Frame rate = 52.356019 frames/second
Loaded 577 animations from animations folder
Finished loading animation bank in 0.343000 sec
Decompressing took 0.011000 seconds
Loaded 608 objects from objects folder
Auto-generated 321 'used' objects
Finished loading object bank in 0.735000 sec
Decompressing took 0.000000 seconds
Loaded 19 categories from categories folder
Finished loading category bank in 1.023000 sec
Decompressing took 0.001000 seconds
Loaded 844 transitions from transitions folder
Auto-generated 330 transitions based on categories
Auto-modified 113 transitions based generic use transitions and auto-added 0 last use generic transitions (7 objects had generic use transitions defined).
Auto-generated 1489 transitions based on used objects, removing 170 transitions in the process
Frame rate = 54.704593 frames/second
Frame rate = 62.500004 frames/second
Frame rate = 62.499994 frames/second
Frame rate = 62.500004 frames/second
Frame rate = 62.500004 frames/second
Using custom server address: localhost:8005
Got length 11 message
SN
0/40
89
Sending message to server: LOGIN [email protected] 4C652048047D9710568C08C7A6654B3A0BFBC6C4 6F602E654B8AA26085BA6768080C77A049C7B5B4#
Got length 9 message
ACCEPTED
Got length 26 message
MC
32 30 -16 -15
6579 546
Got map chunk with bin size 6579, compressed size 546
First chunk isn't too far from center, using 0,0 as our global offset
Map center = 0,0
Got length 3 message
PU
Segmentation fault (core dumped)
Recording of the crash here, but not much to see really since it crashes before getting into the game: https://www.youtube.com/watch?v=0SP2Q35vlwc
Sorry. Deleted last comment and regenerated the recording because I think I messed up the first one. I don't see the empty PU because my stdout.txt ends early... maybe the PU isn't empty but Norgg's stdout isn't flushed after the segfault?
I'm pretty sure it's empty since it says "length 3 message" which is just long enough for the PU and a space/delimiter. I don't see it in the recorded game either though:
Too bad these recordings end before the PU is received.
I wonder what's going on here... I wonder if the server is closing the connection mid-message or something.
Can you run in the debugger and get a stack trace for the crash?
Or how do I reproduce this on my end? How do I get a baby to spawn on top of a bear? Does it work with Eve? Like if I put the bear at 0,0?
Ah, was able to reproduce by putting 8 walls around the spawn point with a bear in the middle.
Go about your business. No more info needed to fix this.
Fixed.