Re: Gtk2::Notebook and switch-page signal [solved]



Signal handler runs well (if defined at all) but after this program dies
with segfault.

Inspection of "core" file shows, that this seems to be a libgtk bug.

Core was generated by `/usr/bin/perl -w ./director -c0 --no-grabber'.
Program terminated with signal 11, Segmentation fault.
[New process 24581]
#0  0xb68cb94b in gtk_notebook_real_switch_page (notebook=0x95c3800, page=0x0, page_num=2) at 
/build/buildd-gtk+2.0_2.12.12-1~lenny2-i386-2RfKoO/gtk+2.0-2.12.12/gtk/gtknotebook.c:5760
        in /build/buildd-gtk+2.0_2.12.12-1~lenny2-i386-2RfKoO/gtk+2.0-2.12.12/gtk/gtknotebook.c
(gdb) 


Here is the source:

/* Private GtkNotebook Page Switch Methods:
 *
 * gtk_notebook_real_switch_page
 */
static void
gtk_notebook_real_switch_page (GtkNotebook     *notebook,
                               GtkNotebookPage *page,
                               guint            page_num)
{
  if (notebook->cur_page == page || !GTK_WIDGET_VISIBLE (page->child))
    return;
[...]

Function gtk_notebook_real_switch_page() is called with page=0.
Unfortunately this pointer is dereferenced without any test.

If I insert this statement before the first "if" it works well:

  if (page == NULL) return;

Version 2.20 contains almost the same code yet.
2.22 code is different but I could not test it against this problem.

So I send some Debian bug reports then I finish this case.

Gabor



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