Author Topic: Crash when debugging  (Read 8010 times)

Offline xplodwild

  • Single posting newcomer
  • *
  • Posts: 3
Crash when debugging
« on: June 25, 2009, 06:16:44 pm »
Hi everyone,

I recently noticed a bug. When my app segfault in debug mode, C::B switch to debugging layout, but then crashes immediately with a X Window System error (BadAlloc). I tried 8.02 and latest SVN build (21 june), same problem happens. I'm running Ubuntu 9.04, and tried xserver-xorg 1.6.0 and 1.6.1 and same problem happens with the two.

What to do ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Crash when debugging
« Reply #1 on: June 25, 2009, 10:28:38 pm »
Can you show the crash report or a backtrace or even a simple test project that reproduces the bug?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline xplodwild

  • Single posting newcomer
  • *
  • Posts: 3
Re: Crash when debugging
« Reply #2 on: June 26, 2009, 10:08:59 am »
All I see in the console before the crash is :

Switching to debugging layout

The program 'codeblocks' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
(Details: serial 788 error_code 11 request_code 145 minor_code 5)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

It happened in a singleton class in a constructor, because the vector wasn't sized correctly. I can't reproduce the bug alone, maybe it's related with other things (my project is composed of nearly 40 files, and most of them are opened simultaneously).

Edit: It appears that it crashes when I open the Call stack window.
« Last Edit: June 26, 2009, 10:51:17 am by xplodwild »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Crash when debugging
« Reply #3 on: June 26, 2009, 11:09:35 am »
Please run codeblock inside gdb:

$ gdb codeblocks
gdb$ run
crash C::B
gdb$ bt

and paste the output

edit:
if the backtrace does not contain meaningful information you should use C::B compiled with debug info in it
« Last Edit: June 26, 2009, 11:13:33 am by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Crash when debugging
« Reply #4 on: June 26, 2009, 11:22:00 am »
We had such a behaviour about one and a half years before (it was in fact a xserver-error).

It has most likeley not the same cause, but nevertheless it might be worth a try:

http://forums.codeblocks.org/index.php/topic,7661.0.html

Offline xplodwild

  • Single posting newcomer
  • *
  • Posts: 3
Re: Crash when debugging
« Reply #5 on: June 26, 2009, 02:11:36 pm »
Where can I  download a debug version of codeblocks? (I think I'll have to compile it myself from SVN)

here's what gives gdb :

Switching layout to "Debugging"
Warning: Using user specified encoding as fallback!
Encoding fallback is: Unicode 8 bit (UTF-8) (ID: 41)
Final encoding detected: Unicode 8 bit (UTF-8) (ID: 41)
[New Thread 0xb10ffb90 (LWP 14695)]
[Thread 0xb10ffb90 (LWP 14695) exited]
found /home/guigui/valachan-server/ouverta_valachan-server/src/GameObject.cpp
The program 'codeblocks' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 80011 error_code 11 request_code 53 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Program exited with code 01.
(gdb) bt
No stack.

So I think to have a stack, I need a debug version ^^

Also, I tried 1.6.0 and 1.6.1 version of Xserver, both give the same result. Also, it appears that only codeblocks crashes (VLC/Firefox and so on works well, it wasn't the case with the 2008's bug).

EDIT : Just compiled latest SVN trunk with --enable-debug, same bug and still no stack

EDIT2 : With --sync, this appears :
(codeblocks:31391): Gtk-CRITICAL **: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed

(codeblocks:31391): Gtk-CRITICAL **: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
« Last Edit: June 26, 2009, 03:37:54 pm by xplodwild »