bad-traffic-accident-like GDB error

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

bad-traffic-accident-like GDB error

Post by d3jake »

I haven't got clue one which section would be considered "proper" to post this in, but I'll try this one.

I have been working hard on my game the last couple of weeks and I am just getting to setting up physics using Cobra's irrBullet wrapper. For a short while now my debugger in Codeblocks has been acting up. Recently for only my main game project the debugger would ignore my breakpoints, and seemingly exit the program altogether for no reason. It finally came to a head when I was trying to figure out the fate of one of my pointers.

My application builds, links, and runs without issue when I'm just running it. When I try to run my application with the debugger (a fancy frontend for GDB) I get this:

Code: Select all

PATH=.;E:\CodeBlocks\irrlicht-1.6\lib\Linux;E:\CodingBucket\irrlicht-1.7.1\lib\Win32-gcc;E:\CodingBucket\irrBullet-0.1.6\lib\Release;E:\CodingBucket\irrBullet-0.1.6\lib\;E:\CodeBlocks\MinGW\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;F:\Program Files\doxygen\bin;C:\Program Files\Bazaar
Command-line: E:\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname  -quiet -args bin/Debug/syzygy.exe
Working dir : E:\CodeBlocks\syzygy\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> catch throw
Catchpoint 1 (throw)
>>>>>>cb_gdb:
> source E:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
>>>>>>cb_gdb:
> directory E:/CodeBlocks/syzygy/
>>>>>>cb_gdb:
> run
gdb: win32_init_thread_list
[New thread 3576.0xe3c]
Catchpoint 1 (exception thrown)
__static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at ../../CodingBucket/irrlicht-1.7.1/include/IQ3Shader.h:21
E:/CodeBlocks/syzygy/../../CodingBucket/irrlicht-1.7.1/include/IQ3Shader.h:21:462:beg:0x413183
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> info locals
No locals.
>>>>>>cb_gdb:
> info args
__initialize_p = 1
__priority = 65535
>>>>>>cb_gdb:
> whatis world
No symbol "world" in current context.
>>>>>>cb_gdb:
> output world
No symbol "world" in current context.
>>>>>>cb_gdb:
> bt 30
#0  __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at ../../CodingBucket/irrlicht-1.7.1/include/IQ3Shader.h:21
#1  0x004131bf in global constructors keyed to _ZN8WellnessC2Ev () at E:/CodeBlocks/syzygy/wellness.cpp:225
#2  0x00425152 in __do_global_ctors () at ../../CodingBucket/irrlicht-1.7.1/include/IQ3Shader.h:21
#3  0x00401095 in __mingw_CRTStartup ()
#4  0x00401148 in mainCRTStartup ()
>>>>>>cb_gdb:
> x/32xb 0x0
Cannot access memory at address 0x0
0x0:	>>>>>>cb_gdb:
> quit
I really haven't clue one as to the issue. It references IQ3shader.h, but something tells me that's just symptomatic of the main issue (whatever it amy be.....). If I shut off stopping on exceptions in the debugger options the application will run normally except any breakpoints that I set are ignored, and the call stack window still contains the stack listed in the blurb above.

I've done some reading around and supposedly this type of error is linked to multi threading, but after I make sure nothing is linking except Irrlicht, it still occurs.

Any clue what it may be..?
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Did you try to continue?
I have a problem in the combination of c::b with gdb on Windows which looks somewhat similar. It always breaks once on start, but after continuing it runs correct.

Also you might try switching to gdb 7.0. It fixed a lot of bugs especially for c++ debugging.

Another thing (once again in combination with c::b on Windows) is that it ignores breakpoints in library code. The trick around that (at least for me) is to set a breakpoint in the application code (usually at the start) and once it stopped there I set the library breakpoints.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
d3jake
Posts: 198
Joined: Sat Mar 22, 2008 7:49 pm
Location: United States of America

Post by d3jake »

I'd be interested in trying to update my gdb installation, but I'm kind of leery as I don't know how to... If it was by itself that may be different, but when it has files scattered throughout CodeBlock's directories, I'm at a bit of a loss to figure it out. Any suggestions as to directions on the matter would be appreciated.

Also, when I have "catch C++ exceptions" enabled it takes 10 clicks of "continue" to proceed to the rest of the application, and it still ignores my breakpoints.

This has me stumped... I even tried to create a new project file and compile in case it was related tot he project file itself, and still no dice. And since it only affects this project, it boggles my mind. I also tried to compile and run this project on Linux on my laptop, and it exhibited the same issues despite it running the older version of Codeblocks...
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Hm, I think I compiled the new gdb from source, at least on Linux (just found out I still seem to run 6.8 on Windows). It's just a single binary, on Windows it's called gdb.exe. So you can either just copy it over the old gdb.exe (maybe do a backup of the old one first) or for example rename it to gdb70.exe.

For c::b you can set in "settings - compiler & Debugger - toolchain executables - debugger" which debugger which you are using.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply