Re: gtk_marshal_BOOL__POINTER() question



On Wed, Sep 14, 2005 at 05:22:08PM -0500, John Gotts wrote:
> Hi, I'm working on solving an intermittent bug with our gtk+ 1.x/Glade 1.x
> application, although my problem should be general enough that people more
> accustomed to 2.x should be able to help.
> 
> We're embedding the GtkSheet widget as a custom widget.  Occasionally, for no
> rhyme or reason, Gtk+ gets into a CPU-consuming loop where the user is locked
> out of X.  Only changing to a virtual terminal and delivering a signal to the
> running process will allow the user to interact with X again.  This bug has
> occurred using various versions of the X server, Fedora Core 2 and 3, RHL 9,
> and on desktops and laptops.  When I deliver a signal to the running process I
> get something like this:
> 
> #0  0x008bc380 in XDrawRectangle () from /usr/X11R6/lib/libX11.so.6
> (gdb) bt
> #0  0x008bc380 in XDrawRectangle () from /usr/X11R6/lib/libX11.so.6
> #1  0x00a1dc68 in gdk_draw_rectangle () from /usr/lib/libgdk-1.2.so.0
> #2  0x00214abf in gtk_sheet_get_active_cell ()
>    from /usr/lib/libgtkextra-0.99.so.17
> #3  0x00226e24 in gtk_sheet_delete_rows () from /usr/lib/libgtkextra-0.99.so.17
> #4  0x00be0e79 in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
> #5  0x00baf333 in gtk_signal_emit_stop_by_name () from /usr/lib/libgtk-1.2.so.0
> #6  0x00bafee7 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
> #7  0x00b751b9 in gtk_widget_event () from /usr/lib/libgtk-1.2.so.0
> #8  0x00be2c0c in gtk_propagate_event () from /usr/lib/libgtk-1.2.so.0
> #9  0x00be2fa7 in gtk_main_do_event () from /usr/lib/libgtk-1.2.so.0
> #10 0x00a1d620 in gdk_event_get () from /usr/lib/libgdk-1.2.so.0
> #11 0x009e7287 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
> #12 0x009e7f13 in g_main_add_poll () from /usr/lib/libglib-1.2.so.0
> #13 0x009e80e5 in g_main_run () from /usr/lib/libglib-1.2.so.0
> #14 0x00be2232 in gtk_main () from /usr/lib/libgtk-1.2.so.0
> #15 0x080d3357 in main (argc=1, argv=0xbfe33584) at main.c:113
> 
> gtk_sheet_delete_rows() is never called by my program.  gtk_sheet_get_active_
> cell() is never called by gtk_sheet_delete_rows().  gdk_draw_rectangle() is
> never called by gtk_sheet_get_active_cell().  Every backtrace of the running
> process is identical up to #2, although there are some variations above it.
> When I put a debugging printf() in gtk_sheet_delete_rows() nothing is printed,
> which tells me that the stack got corrupted somehow.  Admittedly, I'm no
> debugger expert.  Perhaps someone could fill me in on how obviously not
> called functions can appear in a backtrace?
> 
> Any clues on how to diagnose this problem?  Is it just a random double free()
> somewhere in my application which happens to stomp all over memory or could it
> be a Gtk+ bug of some kind?

ah, don't you love problems like that?  I love them.  ;)

first re-compile with optimizations turned off.  still have a problem?
still get a weird stack?  compiler optimazations can make instructions
seem to run out of order.  I don't recall this ever affecting the stack
like this though.

second.  are you using any sort of non-linear processing like threads or
posix signals?  or... long-jump stuff?  (other?)  Don't mess with any
gtk widgets during a posix signal handler.  it will screw things up.

also, when I'm looking at wonky stacks I look for pointers that point
into the stack, and double check how they're being used.

good luck.

- Ben



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]