Author Topic: Mod development: hunting down segfaults  (Read 3037 times)

Risujin

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
Mod development: hunting down segfaults
« 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?

vcxzet

  • Guest
Mod development: hunting down segfaults
« Reply #1 on: November 17, 2006, 11:19:49 pm »
segfaults happen

Yarou

  • Posts: 218
  • Turrets: +43/-109
Mod development: hunting down segfaults
« Reply #2 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).


Currently:
{&}Yarou

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Mod development: hunting down segfaults
« Reply #3 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)
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok 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

  • Posts: 739
  • Turrets: +33/-13
    • http://risujin.org
Re: Mod development: hunting down segfaults
« Reply #4 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. :)