Skip to content

Segfaults

jmdejong edited this page May 8, 2018 · 3 revisions

A Segfault (Segmentation Fault) is an error that is very difficult to make out, one usually needs a debugger for that. This is a small howto for debugging segfaults in UH. Join via IRC if you have further questions.

A possible cause for a segfault is that you are creating some object, pass it to FIFE, and then don't keep it around in python anymore. The python garbage collector can then remove that object and give away its memory, unaware that FIFE still needs it. When FIFE then tries to access the object it will throw a segfault.

Linux

  1. You will need gdb, your distribution provides a package for that.
  2. You need a debug build for fife, you can get that by compiling fife with ~/fife/trunk $ scons --enable-debug in the FIFE directory
  3. Run this in your UH directory to start UH: ~/unknown-horizons $ gdb --args python ./unknown-horizons
  4. Enter r followed by the enter key in the prompt that will appear
  5. Reproduce the crash.
  6. Enter bt (again, followed by enter) in the prompt that will reappear at a segfault.
  7. Paste all output to a pastebin like [this one] (http://bpaste.net/+pytb).
  8. Send us the resulting link via IRC or forums.

Category:Development

Clone this wiki locally