Meaningful backtrace from your debugger if you break on the gdk_x_error

Elvis Wong
Mon Dec 14 15:46:00 GMT 2009

Hi all, im new to gdb.

I try to debug an application that crash;

here what i try;

$ gdb --args test --sync

(gdb) break gdk_x_error
Function "gdk_x_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (gdk_x_error) pending

(gdb) run

The program 'test' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 15391 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.)
[Thread 0xb7e1ab70 (LWP 7469) exited]
[Thread 0xb7125b70 (LWP 7470) exited]
[Thread 0xb691fb70 (LWP 7471) exited]
[Thread 0xb611eb70 (LWP 7472) exited]
[Thread 0xb3e02b70 (LWP 7482) exited]
[Thread 0xb57ffb70 (LWP 7485) exited]
[Thread 0xb3601b70 (LWP 7486) exited]

Program exited with code 01.
(gdb) bt
No stack.
(gdb) i r
The program has no registers now.

How can i catch this bug?

thanks all!

More information about the Gdb mailing list