Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get a backtrace on Linux
06-12-2012, 05:24 PM, (This post was last modified: 01-17-2014, 08:08 PM by Max.)
Post: #1
How to get a backtrace on Linux
This post will give you an easy way to help the development team fix bugs. Before you start:
  • You must be able to compile the game. If you installed the game from you distribution's repositories or downloaded it from our download page, you should make sure you can compile the game first. If you compiled the game yourself using our standard build system, debugging symbols are already included in your Alien Arena executable. This may not be the case if you installed the game from another source.
  • The bug you are testing should be a crash or a freeze. This technique will not work for gameplay bugs like weapons doing too much damage or the like.
  • You must be able to reproduce the problem easily. You need to have a procedure you can follow which will always cause the bug.
  • You must have gdb installed. This is almost always available in your distribution's repositories.

Now you can debug the problem with gdb. This is kind of a rigmarole, because if a program freezes or crashes with the mouse grabbed when it's running in gdb, there's no way to ever get it to ungrab the mouse. Here's how you work around this:
  • Go to the first virtual terminal using control-alt-F1. Log in with your normal user account.
  • Run this command:
    Code:
    DISPLAY=:0.0 gdb alienarena
  • Then, at the gdb prompt, run these commands:
    Code:
    set logging file crx.log
    set logging on
    run
  • Switch back to the main virtual terminal with control-alt-F7. The game should already be running. This will take a while, you may have to stare at a blank screen for a couple minutes. Somtimes I find that pulling down the console can force the screen to refresh.
  • Go ahead and try to crash the game with your normal procedure.
  • Switch back to virtual terminal 1 using control-alt-F1. This will take a while.
  • Hit control-C to pause the game's execution and get a gdb prompt again.
  • At the gdb prompt, run these commands:
    Code:
    thread 1
    bt
    thread 2
    bt
    quit
  • crx.log will now be a file with information that I can use to figure out what's going on.
  • Switch back to your main virtual terminal using control-alt-F7. The game should not be running anymore. Now that there's no game running, switching virtual terminals should be faster.

Please copy crx.log into pastebin and create a forum post linking to it. Also remember to describe the procedure which causes the crash.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)