Re: Segfault in gtkclist.c on removing last row

I've heard that there might be a bug in CList so when you
want to take out the last row, you should do a gtk_clist_clear()
rather than just removing that last row.

Oliver Elphick wrote:
> I have a program which allows the user to select a row in a glist and click
> a button to remove the row.
> If I add one row to an empty clist and then remove it, I have no problem,
> but if I had more than one row and remove each of them (one at a time), the
> program segfaults on removing the last row.
> The clist is inside a scrolled window.
> Here is the backtrace (gtk+ 1.2.8, Debian package from Helix):
> #0  draw_rows (clist=0x889a9b8, area=0xbfffe55c) at gtkclist.c:5957
> #1  0x8536823 in vadjustment_value_changed (adjustment=0x889a910,
>     data=0x889a9b8) at gtkclist.c:6211
> #2  0x85616a4 in gtk_marshal_NONE__NONE (object=0x889a910,
>     func=0x85365fc <vadjustment_value_changed>, func_data=0x889a9b8,
>     args=0xbfffe65c) at gtkmarshal.c:312
> #3  0x85879b4 in gtk_handlers_run (handlers=0x8891780, signal=0xbfffe608,
>     object=0x889a910, params=0xbfffe65c, after=0) at gtksignal.c:1917
> #4  0x8586f9e in gtk_signal_real_emit (object=0x889a910, signal_id=95,
>     params=0xbfffe65c) at gtksignal.c:1477
> #5  0x8585731 in gtk_signal_emit_by_name (object=0x889a910,
>     name=0x865bcc7 "value_changed") at gtksignal.c:618
> #6  0x85361dc in adjust_adjustments (clist=0x889a9b8, block_resize=0)
>     at gtkclist.c:6074
> #7  0x852eb32 in real_remove_row (clist=0x889a9b8, row=0) at gtkclist.c:2779
> #8  0x852e61f in gtk_clist_remove (clist=0x889a9b8, row=0) at gtkclist.c:2606
> The segfault is because list is an invalid pointer.
> I haven't got any further with diagnosis, but perhaps someone has an idea
> of what is going wrong?
> (I won't bother to show the code at this stage, because I am using an
> Eiffel wrapper of GTK+; the C code generated by the Eiffel compiler is not
> comprehensible to humans.)
> I also have a problem with debugging, because if I hit a breakpoint, the whole
> of
> X freezes and I have to go to a console window to use the debugger, which is
> inconvenient.  It also means I can't use ddd.  Is there any way to get
> round this?
> --
> Oliver Elphick                      
> Isle of Wight                    
> PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
> GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
>                  ========================================
>      "Have not I commanded thee? Be strong and of a good
>       courage; be not afraid, neither be thou dismayed; for
>       the LORD thy God is with thee whithersoever thou
>       goest."                        Joshua 1:9
> _______________________________________________
> gtk-list mailing list

| Jeff "Shippy" Shipman     E-Mail: |
| Computer Science Major    ICQ: 1786493              |
| New Mexico Institute of Mining and Technology       |
| Homepage:                |

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