User forums > General (but related to Code::Blocks)

C::B crashes after Debug - Next Line

(1/3) > >>

benezan:
I have a strange problem with Code::Blocks when debugging. I have used the debugger (GDB) successfully many times until now. Most of the timne it worked flawlessly. Now, when I'm trying to step through the code line by line with "Next line (F7) I get the folowing error messages:

--- Code: ---Starting debugger: C:\Programme\MinGW\bin\gdb.exe -nx -fullname  -quiet  -args E:/Projekte/BeamiconII/Source/Beamicon2/bin/Debug/Beamicon2.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 3128
At E:\Projekte\BeamiconII\Source\Beamicon2\src\gcodeparser.cpp:275
Error accessing memory address 0x7816cd30: Input/output error.
Error accessing memory address 0x785947d8: Input/output error.

--- End code ---
I've set a breakpoint at line #275 then hit F7 once. The strange thing is that if I place the cursor in the next line and use "run to cursor" it works. After a second "Next line" my program freezes and I can't do anything with the debugger anymore. When I try "stop debugger" I get this message

--- Code: ---At E:\Projekte\BeamiconII\Source\Beamicon2\src\gcodeparser.cpp:275
Continuing...
At E:\Projekte\BeamiconII\Source\Beamicon2\src\gcodeparser.cpp:282
Error accessing memory address 0x7816cd30: Input/output error.
Error accessing memory address 0x785947d8: Input/output error.
Trying to pause the running process...
Trying to pause the running process...

--- End code ---
but nothing happens. C::B still reacts to mouse clicks but I can't stop the debugger, so all I can do is closing it alltogether with the window close button. Then the windows message "Code::Blocks has a problem..." pops up but even after that it's not gone. I have to kill the process with the task manager, otherwise I can not start it again.

My first thought was that the problem is related to some bug in my own code but I think if it was a dangling pointer or currupted memory problem I should get a segmentation fault and a controlled termination. And why does it work when using "run to cursor"? ??? I'm also aware that this might be a compiler/gdb problem and no C::B problem, but I have no way of finding out other than to ask here if somebody else has had the same problem before.

Some more things I found out:
* The problem does not show up all the time but when it does it's deterministic. I tried out other projects, with some of them "next line" still works. Even inside different cpp files of the same project, sometimes it works sometimes it doesn't. But when it's there it's persistent.
* The same code compiled with the same MinGW version and the same C::B settings (we copied the .cbp file and only replaced the path names) works perfectly with the debugger on my friend's PC.
* My program runs without problems when started without debugger or with debugger but without breakpoints.
* I use C::B V12.11 and MinGw 2012-04-26.

Any hints what to look for greatly appreciated...

Jenna:
This might be related:
http://forums.codeblocks.org/index.php/topic,14847.msg99440.html#msg99440
but your problem seems to be in a cpp not in a header file.

Nevertheless, did you try to do a full rebuild (clean and build) and did you look for probably existing older precompiled headers (usually *.gch).

ollydbg:

--- Quote from: benezan on December 31, 2013, 03:25:46 pm ---
* I use C::B V12.11 and MinGw 2012-04-26.

Any hints what to look for greatly appreciated...

--- End quote ---
What is "MinGW 2012-04-26" ?

Also, can you give us a simple project? I have some different version of GCC, and I build GDB GIT HEAD from time to time, so I would like to test/reproduce this issue.

Thanks.

benezan:
Hmm, Yes I actually have two header files without cpps. One is a header for a DLL, the other defines a pure virtual class. I don't see how this could cause any trouble but I can try to remove them.

And yes, I tried a full rebuild, it didn't help. I can try to delete the precompiled headers manually.

I'm also doing a complete re-install on a different PC with newer versions (C::B 13.12 and MinGw 4.7.1) to see if this helps. It takes a while though because I have to recompile all the libraries.

Ollydbg,
I've found no version info other than the build date. The download ("mingw-get-inst-20120426.exe") is no longer available on sourceforge... Unfortunatelly, my project is very big and has lots of dependencies. It doesn't happen with small projects. I'm going to try out the newer MinGw/C::B versions first. If it doesn't help I'll try to strip down my project to the smalles possible that reproduces the problem.

Thanks

benezan:
Update: deleting the pch file manually didn't help.
Adding cpp files to the implementaion-less headers didn't help.
New installation is still compiling...

See you next year  ;)

Navigation

[0] Message Index

[#] Next page

Go to full version