News:

Come Chat with us live! Learn how HERE!

Main Menu

Mod development: hunting down segfaults

Started by Risujin, November 17, 2006, 11:04:16 PM

Risujin

Whats the best way to hunt down the source of a segfault? What debuggers work with Tremulous?


Yarou

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).


Currently:
{&}Yarou

kevlarman

Quote from: RisujinWhats 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)
Quote from: Asvarox link=topic=8622.msg169333#msg169333Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Risujin

Quote from: kevlarman
Quote from: RisujinWhats 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. :)