One Hour One Life Forums

a multiplayer game of parenting and civilization building

You are not logged in.

#1 2017-06-25 06:36:10

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

How to catch crashes

When the game crashes, I need as much information as possible about where the crash happened in the code.  A stack trace, as generated by a debugger, pinpoints the source of the crash.


First of all, for ALL platforms, I'd like to receive your log.txt file and as much of your game's output as you have available.  If you're running on Windows, this should be saved in stdout.txt.  On other platforms, you can copy-paste all available screens of text from the terminal.

These text dumps can be quite large, but they compress well.  ZIP-ing them will help, or you can post them to DropBox or a similar service and send me the link.




Windows

If you're on Windows, no debugger is included with your operating system.

I've packaged a stand-alone version of the open-source GDB debugger, along with a script to make debugging easy on Windows.

You can find it downloading WindowsDebugTools ZIP file from your original download link.  Unzip it and read the included instructions.

Note that when a crash happens, the game will appear to freeze instead of dying.  That's because the debugger has caught the crash.  Alt-tab over to the debugger to see if it caught something.

The full output of the debugger should be automatically saved to debugOut.txt.  Email it to me:  jasonrohrer AT fastmail DOT fm




Linux

If you're on Linux, you can install GDB using your package manager (example:  sudo apt-get install gdb).  Take the game out of fullscreen mode to make debugging easier (look in the settings folder).

Then, you can run the game in gdb from the command line:

gdb ./OneLifeApp

Once inside gdb, type   run   to start the game.

Again, if the game freezes, alt-tab back to the debugger to see what has been caught.

Type   bt   to print a stack trace.

Copy and paste this text into an email to me.

Type    generate-core-file

gzip the resulting core file and email it to me.

Type   q   to quit the debugger.

Copy the debugger output and email it to me:  jasonrohrer AT fastmail DOT fm





MacOS

If you're on MacOS, the latest dev tools ship with lldb.  HOWEVER, I've found that lldb does a bad job of producing exact line numbers.  Thus, it's better if you actually install gdb.  It should be pretty easy.  If you don't already have them, install the XCode command-line tools.  In a terminal, type this:

xcode-select --install

Next, install Homebrew (https://brew.sh/).  You can install Homebrew in a terminal by typing this:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Finally, use Homebrew to install gdb:

brew install gdb

On mac, gdb works pretty much the same as in the Linux instructions.  However, you'll need to launch the game a bit differently:

Open a Terminal, and "cd" into your game folder.  Something like:

cd Desktop/OneLife_v217

Now launch the game inside gdb:

gdb OneLife_v248.app/Contents/MacOS/OneLife

(The actual executable is two layers deep inside the .app bundle.)

NOTE:  Your app bundle will likely have a different version number in the name (the example is v248).  Use the latest version that you see in your game folder.

Once inside gdb, follow the GDB instructions for Linux above.

Offline

#2 2017-06-25 16:48:08

HartLabs
Member
Registered: 2017-06-24
Posts: 2

Re: How to catch crashes

Just to note to launch with non-console use in Windows extract to the root game folder, launch GDB, type "target exec OneLife.exe" then "run".

Offline

#3 2017-06-25 20:43:52

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

Re: How to catch crashes

Is the included .bat file not working?

It should do all that stuff automatically for you (start GDB, run the game, etc.)

Offline

#4 2017-06-27 02:01:15

HartLabs
Member
Registered: 2017-06-24
Posts: 2

Re: How to catch crashes

Oh cool! Didn't even see that.

Offline

#5 2018-03-16 19:48:19

Chefbrenner
Member
Registered: 2018-03-01
Posts: 4

Re: How to catch crashes

On MacOs, when you are using lldb, the command to create a core file is process save-core <destination-path>.

Offline

#6 2018-03-31 05:45:44

Homura
Member
Registered: 2018-03-31
Posts: 7

Re: How to catch crashes

Edit: After reinstalling I got the message: failed to apply update - move game folder somewhere that is not read-only. When I delete the original installation it says it's in use by another program (even after deleting everything in the folder).

Moved to my downloads folder, patched, and now it works.

Graphics mismatch items after today's update until I disable customserver.txt and patch. Maybe give us a message when our client version does not match server version?

Instructions.txt Discord link is expired.

Within a minute of spawning the game freezes indefinitely and then crashes when I input any button, generating this error:

Program received signal SIGSEGV, Segmentation fault.
0x00447c4c in LivingLifePage::step (this=0xdc99f28)
    at LivingLifePage.cpp:11206
11206    LivingLifePage.cpp: No such file or directory.
#0  0x00447c4c in LivingLifePage::step (this=0xdc99f28)
    at LivingLifePage.cpp:11206
#1  0x00424dc5 in PageComponent::base_step (this=0xdc99f28)
    at PageComponent.cpp:54
#2  0x00426b00 in GamePage::base_step (this=0xdc99f28) at GamePage.cpp:334
#3  0x004038b3 in drawFrame (inUpdate=1 '\001') at game.cpp:1234
#4  0x004bcf23 in GameSceneHandler::drawScene (this=0x246fc58)
    at ../../minorGems/game/platforms/SDL/gameSDL.cpp:3055
#5  0x00492fd5 in callbackDisplay ()
    at ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2799
#6  0x00491adc in ScreenGL::start (this=0x246e518)
    at ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2040
#7  0x004bbe74 in mainFunction (inNumArgs=1, inArgs=0x2432e68)
    at ../../minorGems/game/platforms/SDL/gameSDL.cpp:2483
#8  0x004b7828 in SDL_main (inArgCount=1, inArgs=0x2432e68)
    at ../../minorGems/game/platforms/SDL/gameSDL.cpp:23
#9  0x004d22ab in console_main (argc=1, argv=0x2432e68)
    at ./src/main/win32/SDL_win32_main.c:246
#10 0x004d2489 in WinMain (hInst=0x400000, hPrev=0x0, szCmdLine=0xbe3cb1 "",
    sw=10) at ./src/main/win32/SDL_win32_main.c:382
#11 0x0050266b in main ()

Every. Single. Spawn.
Reconnecting just births a new baby.

Last edited by Homura (2018-03-31 22:25:48)

Offline

#7 2018-07-13 01:51:06

MidgetMaker
Member
Registered: 2018-04-16
Posts: 150

Re: How to catch crashes

Running the debugger makes my game stutter.  thought it was lag at first but the stutter only happens when i use the debugger. sad

Offline

#8 2019-11-05 07:21:09

miskas
Member
From: Greece
Registered: 2018-03-24
Posts: 1,095

Re: How to catch crashes

jasonrohrer wrote:

I've packaged a stand-alone version of the open-source GDB debugger, along with a script to make debugging easy on Windows.

You can find it downloading WindowsDebugTools.zip from your original download link.  Unzip it and read the included instructions.

where can I find this cause link is dead.


Killing a griefer kills him for 10 minutes, Cursing him kills him for 90 Days.

4 curses kill him for all of us,  Mass Cursing bring us Peace! Please Curse!
Food value stats

Offline

#9 2019-11-05 13:07:33

Starknight_One
Member
Registered: 2018-10-15
Posts: 347

Re: How to catch crashes

miskas wrote:
jasonrohrer wrote:

I've packaged a stand-alone version of the open-source GDB debugger, along with a script to make debugging easy on Windows.

You can find it downloading WindowsDebugTools.zip from your original download link.  Unzip it and read the included instructions.

where can I find this cause link is dead.

Check your update emails, there should be a link to the download page there.

Offline

#10 2019-11-05 14:14:21

miskas
Member
From: Greece
Registered: 2018-03-24
Posts: 1,095

Re: How to catch crashes

yay! found it, thanks!
https://prnt.sc/psrt36


Killing a griefer kills him for 10 minutes, Cursing him kills him for 90 Days.

4 curses kill him for all of us,  Mass Cursing bring us Peace! Please Curse!
Food value stats

Offline

#11 2019-11-05 23:48:43

jasonrohrer
Administrator
Registered: 2017-02-13
Posts: 4,805

Re: How to catch crashes

Yeah, the forum is thinking that file name is a link.... sorry!

Offline

#12 2021-03-02 15:18:14

tinspin
Member
Registered: 2021-03-02
Posts: 1

Re: How to catch crashes

I guess you are using MinGW to compile the game too, I prefer cl.exe and managed to "extract" it from VS and even if it's not allowed to be redistributed for windows it makes smaller executables and allows me to compile from inside my engine.

I never did manage to make a stand alone version of MinGW, did you?

I made my own in-engine debugger on windows so it can automatically send crashes to my server:

http://move.rupy.se/file/stack.html

That way the player doesn't need to zip, upload or mail anything.

Might work with MinGW too...

Offline

Board footer

Powered by FluxBB