Tremulous Forum

General => Troubleshooting => Topic started by: Risujin on November 17, 2006, 11:04:16 pm

Title: Mod development: hunting down segfaults
Post by: Risujin on November 17, 2006, 11:04:16 pm
Whats the best way to hunt down the source of a segfault? What debuggers work with Tremulous?
Title: Mod development: hunting down segfaults
Post by: vcxzet on November 17, 2006, 11:19:49 pm
segfaults happen
Title: Mod development: hunting down segfaults
Post by: Yarou on November 17, 2006, 11:25:20 pm
Every conceivable debugger that you can think of.
The best debugger for segfaults is one that operates in ring0, or kernelmode.
i.e. SoftIce, rr0d, etc.
(Assuming you're on Win32).
Title: Re: Mod development: hunting down segfaults
Post by: kevlarman on November 18, 2006, 03:12:15 am
Quote from: "Risujin"
Whats the best way to hunt down the source of a segfault? What debuggers work with Tremulous?
load up the shared object libraries instead of qvms, use your favorite debugger (although i doubt it will work well without dual monitors for client hacks)... or stop dereferencing NULL, i don't even remember the last time i did that in code i wrote (maybe around the time of my printf("hello world\n") days)
Title: Re: Mod development: hunting down segfaults
Post by: Risujin on November 19, 2006, 10:24:12 pm
Quote from: "kevlarman"
Quote from: "Risujin"
Whats the best way to hunt down the source of a segfault? What debuggers work with Tremulous?
load up the shared object libraries instead of qvms, use your favorite debugger (although i doubt it will work well without dual monitors for client hacks)... or stop dereferencing NULL, i don't even remember the last time i did that in code i wrote (maybe around the time of my printf("hello world\n") days)

Turns out the problem was this line:
*0 = 1;

Actually I'd added new methods of death and forgotten to add *debug strings* for them and it didnt like reading off the deep end of the array.

Good idea about the libraries. QVMs dont make a lot of sense to gdb. :)