bugle-unwindstack - recover a stack trace after a segmentation fault
Some OpenGL drivers (particularly proprietry drivers) are compiled without frame
pointer information. The result is that if you pass a bad pointer to the
driver, causing it to segfault, gdb
(1) is unable to produce a stack
trace showing that location of the fault. This filter-set uses some ugly hacks
to try to correct this.
When using this filter-set and debugging your application in gdb
segmentation fault will still leave you without a stack trace. However, if you
continue running, you will get a second segmentation fault, at which point a
stack trace is available.
Note that the call that causes the segmentation fault may not be the direct
cause; for example, a bad pointer passed to glVertexPointer
cause a segmentation fault in glDrawArrays
. See also the
(7) filter-set, which does some aggressive error-checking
and can detect some of these conditions.
The method used to recover the stack trace violates POSIX rules (and common
sense) about the use of setjmp
. It works for me under Linux with NVIDIA
drivers, but your mileage might vary.
bugle is written and maintained by Bruce Merry.