Author Topic: Can't debug - GDB segfaults  (Read 8461 times)

Offline mmebane

  • Multiple posting newcomer
  • *
  • Posts: 33
Can't debug - GDB segfaults
« on: September 12, 2006, 05:20:19 pm »
I'm using the latest SVN build on Windows XP, with MinGW 5.0.3 installer and latest MinGW candidates.

Anyway, every time I try to debug something, GDB crashes on me with a segfault, before I have a chance to do anything.

Code::Blocks is built with GCC 4.1.1, if that matters. I haven't tried rebuilding it with 3.4.5.
It doesn't seem to matter whether I compile my projects with 4.1.1 or 3.4.5.

Code
Building to ensure sources are up-to-date
Build succeeded
Selecting target: Debug|Win32
Adding source dir: C:\Documents and Settings\Mitchell\My Documents\Baylor\2006-02 - Fall\CSI 3334-01\src\Project 2 - Shortest-path maze solver\Project 2 - Shortest-path maze solver\
Adding source dir: C:\Documents and Settings\Mitchell\My Documents\Baylor\2006-02 - Fall\CSI 3334-01\src\Project 2 - Shortest-path maze solver\Project 2 - Shortest-path maze solver\
Adding file: Project 2 - Shortest-path maze solver.exe
Starting debugger: done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.3
Program received signal SIGSEGV, Segmentation fault.
In ntdll!RtlpWaitForCriticalSection () (ntdll.dll)

I couldn't find any other references to this on the forum, so is it just me?
« Last Edit: September 12, 2006, 05:37:41 pm by mmebane »

Offline crzysdrs

  • Single posting newcomer
  • *
  • Posts: 7
Re: Can't debug - GDB segfaults
« Reply #1 on: September 12, 2006, 06:48:58 pm »
I haven't seen quite the same issue but I am using C::B under Gentoo Linux (the latest Subversion) and my debugger doesn't seem to work "as advertised". I see no indicator of what line I am on and all I can really do with the debugging is to just run it. The only clues the debugger gives me is when the application segfaults and gives me a backtrace. Breakpoints don't seem to work nor does trying to step through the code. Perhaps our two issues are intertwined (as we are both using subversion builds)?

Offline mmebane

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Can't debug - GDB segfaults
« Reply #2 on: September 13, 2006, 03:51:58 am »
This is interesting... I just noticed that debugging still does work, even after the segfault. I wonder what is segfaulting?

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Can't debug - GDB segfaults
« Reply #3 on: September 13, 2006, 05:12:23 am »
It seems it's your program the one that is segfaulting. Have you tried to run it from a console? Do you get the segfault that way? Is there anything useful from the backtrace?

Offline mmebane

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Can't debug - GDB segfaults
« Reply #4 on: September 13, 2006, 06:37:09 am »
It's not me - even the CodeBlocks sample C++ Hello World program segfaults if I try to debug it.

Oh, and the backtrace is not helpful - almost entirely unknown symbols. :/

Weird.
« Last Edit: September 13, 2006, 06:48:09 am by mmebane »

mdelfede

  • Guest
Re: Can't debug - GDB segfaults
« Reply #5 on: September 13, 2006, 11:02:16 am »
I'm using the latest SVN build on Windows XP, with MinGW 5.0.3 installer and latest MinGW candidates.

Anyway, every time I try to debug something, GDB crashes on me with a segfault, before I have a chance to do anything.

Code::Blocks is built with GCC 4.1.1, if that matters. I haven't tried rebuilding it with 3.4.5.
It doesn't seem to matter whether I compile my projects with 4.1.1 or 3.4.5.


hmmmmm... sorry if I am a bit off topic, but I'd like to know how you did manage to compile C::B and wxWidgets with GCC 4.1.1 on windows XP. I tried some days ago with 4.0.3 and it failed compiling. Where did you get GCC4.1.1 for mingw ?

Best Regards

Max

sethjackson

  • Guest
Re: Can't debug - GDB segfaults
« Reply #6 on: September 13, 2006, 06:06:59 pm »
Well I noticed that the path to your project is kinda long.....
Could you try creating a Hello World app on the desktop and try debugging that?

Offline mmebane

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: Can't debug - GDB segfaults
« Reply #7 on: September 15, 2006, 03:03:39 am »
hmmmmm... sorry if I am a bit off topic, but I'd like to know how you did manage to compile C::B and wxWidgets with GCC 4.1.1 on windows XP. I tried some days ago with 4.0.3 and it failed compiling. Where did you get GCC4.1.1 for mingw ?

Best Regards

Max


http://gda.utp.edu.co/~ceniza/
I think I built wxWidgets with 3.4.5, but I don't remember.

---

Well I noticed that the path to your project is kinda long.....
Could you try creating a Hello World app on the desktop and try debugging that?

Code
Building to ensure sources are up-to-date
Build succeeded
Selecting target: Debug
Adding source dir: C:\test\
Adding source dir: C:\test\
Adding file: .\test.exe
Starting debugger: done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.3
Program received signal SIGSEGV, Segmentation fault.
In ntdll!RtlpWaitForCriticalSection () (ntdll.dll)

EDIT: It doesn't seem to be CodeBlocks; I still get a segfault even when running gdb from the command line.

Code
C:\test>gdb test.exe
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) start
Breakpoint 1 at 0x40134c: file main.cpp, line 3.
Starting program: C:\test/test.exe

Program received signal SIGSEGV, Segmentation fault.
0x7c918fea in ntdll!RtlpWaitForCriticalSection () from ntdll.dll
(gdb) continue
Continuing.
main () at main.cpp:3
3       int main()
(gdb) continue
Continuing.
Hello world!

Program exited normally.
(gdb) quit

C:\test>
« Last Edit: September 15, 2006, 03:11:13 am by mmebane »