Unexpected segfaults: segfault branch created



Hello Lupus!

I  have  made a  tarball  of  the  "segfault-1-branch" branch  of  the
pimpaq        project.        It         is        available        in
http://spam.sch.bme.hu/~dlux/pimpaq/segfault.tgz.

I have  added a dummy  database driver, so  you won't need  to install
mysql :-)

I  have  removed  all  the   GtkToggleButtons  from  the  glade  files
(category  and date-time  selection  windows) and  replaced them  with
GtkButtons.  If you  change them  back,  then no  segfault will  occur
(only        in        PDA/pimPAQ/CategorySelect/main.glade        and
PDA/pimPAQ/DateTimeSelect/main.glade).

To cause segfault, do:

cd pimpaq; ./todo.pl

Click to "New..."

Click to  the button next to  the "Start" label or  "Categories" label
, and you will get segfault.

If you do the following, you won't get segfault:

cd pimpaq; ./todo.pl

Click to View/Edit Categories

Close the  window which appears, and  you can click then  anywhere, no
segfault will occur.

Before you ask, I  want to tell that it is a framework,  and I need to
read more glade files runtime.

The user  interface initialization  is done  in the  PDA/pimPAQ.pm, in
the ui_init subroutine.

The glade-file  loader is situated  in the load_window  subroutine. It
is quite complicated, but you can replace it with the following sub:

sub load_window { my ($s)= _;
  my $g=$s->{glade}=Gtk::GladeXML->new(
    $s->{app}->home."/".$s->glade_file,$s->window_name);
  $g->signal_autoconnect_from_package($s);
};

I  have made  this  sub complicated,  because I  thought  perl 5.6  is
buggy,  but after  I tested  it with  perl 5.005_03,  I realized  that
problem is in some other place.

The custom  widgets can be  found in the  PDA/pimPAQ/widget directory.
They  are in  use  and works  well. The  custom-widget  loader can  be
found  in the  PDA/pimPAQ.pm, it  is called  "load_custom_widget", and
called  by Gtk::GladeXML::create_custom_widget  (can be  found in  the
same module).

Here is a stack trace of one segfault:

#0 0x80bdb58 in Perl_pp_method_named ()
#1 0x80bd65e in Perl_pp_method ()
#2 0x80b415d in Perl_runops_debug ()
#3 0x80ec763 in Perl_pp_exit ()
#4 0x80ec849 in Perl_pp_exit ()
#5 0x80ef276 in Perl_pp_entereval ()
#6 0x80b415d in Perl_runops_debug ()
#7 0x805e12d in perl_call_sv ()
#8 0x805da09 in perl_call_sv ()
#9 0x40309ed6 in connect_func_handler (
    handler_name=0x83e1840 "on_add_edit_selected", object=0x8356728,
    signal_name=0x83e1860 "clicked", signal_data=0x4030cd40 "",
    connect_object=0x0,      after=0,     user_data=0x83d316c)      at
    GladeXML.xs:49
#10    0x4059fe23    in     glade_xml_signal_autoconnect    ()    from
/usr/lib/libglade.so.0
#11      0x40478195      in     g_hash_table_foreach      ()      from
/usr/lib/libglib-1.2.so.0
#12 0x4059ff85 in glade_xml_signal_autoconnect_full ()
   from /usr/lib/libglade.so.0
#13     0x4030b959     in     XS_Gtk__GladeXML_signal_autoconnect_full
(cv=0x8277fc4)
    at GladeXML.xs:196
#14 0x80bc97b in Perl_pp_entersub ()
#15 0x80b415d in Perl_runops_debug ()
#16 0x80ec763 in Perl_pp_exit ()
#17 0x80ec849 in Perl_pp_exit ()
#18 0x80eec98 in Perl_pp_require ()
#19 0x80b415d in Perl_runops_debug ()
#20 0x805e12d in perl_call_sv ()
#21 0x805da09 in perl_call_sv ()
#22  0x4023675b in  marshal_signal (object=0x83a66e8,  data=0x83b243c,
nparams=0,
    args=0xbfffeb4c, arg_types=0x0, return_type=1) at Gtk.xs:205
#23 0x403d06b9 in gtk_signal_remove_emission_hook ()
   from /usr/lib/libgtk-1.2.so.0
#24      0x403cfaf5      in     gtk_signal_set_funcs      ()      from
/usr/lib/libgtk-1.2.so.0
#25 0x403cdbd3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#26      0x4033eae8      in       gtk_button_clicked      ()      from
/usr/lib/libgtk-1.2.so.0
#27      0x4034010d     in      gtk_button_get_relief     ()      from
/usr/lib/libgtk-1.2.so.0
#28     0x403a1d41      in     gtk_marshal_NONE__NONE      ()     from
/usr/lib/libgtk-1.2.so.0
#29      0x403cf98f      in     gtk_signal_set_funcs      ()      from
/usr/lib/libgtk-1.2.so.0
#30 0x403cdbd3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#31      0x4033ea28      in      gtk_button_released      ()      from
/usr/lib/libgtk-1.2.so.0
#32      0x4033fa78     in      gtk_button_get_relief     ()      from
/usr/lib/libgtk-1.2.so.0
#33     0x403a19cb     in    gtk_marshal_BOOL__POINTER     ()     from
/usr/lib/libgtk-1.2.so.0
#34      0x403cfb33      in     gtk_signal_set_funcs      ()      from
/usr/lib/libgtk-1.2.so.0
#35 0x403cdbd3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0
#36 0x40403feb in gtk_widget_event () from /usr/lib/libgtk-1.2.so.0
#37      0x403a1935      in      gtk_propagate_event      ()      from
/usr/lib/libgtk-1.2.so.0
#38 0x403a0b5e in gtk_main_do_event () from /usr/lib/libgtk-1.2.so.0
#39     0x4044e027     in      gdk_wm_protocols_filter     ()     from
/usr/lib/libgdk-1.2.so.0
#40      0x4047b2b9      in       g_get_current_time      ()      from
/usr/lib/libglib-1.2.so.0
#41      0x4047b8c3      in       g_get_current_time      ()      from
/usr/lib/libglib-1.2.so.0
#42 0x4047ba5c in g_main_run () from /usr/lib/libglib-1.2.so.0
#43 0x403a0457 in gtk_main () from /usr/lib/libgtk-1.2.so.0
#44 0x402395cd in XS_Gtk_main (cv=0x825f6d4) at Gtk.xs:931
#45 0x80bc97b in Perl_pp_entersub ()
#46 0x80b415d in Perl_runops_debug ()
#47 0x805d3ef in perl_run ()
#48 0x805cff1 in perl_run ()
#49 0x8059cc5 in main ()
#50 0x40079c14 in __libc_start_main () from /lib/i686/libc.so.6
#51 0xbffffb34 in ?? ()
#52 0x6e69622f in ?? ()

Regards, and waiting for your answer,

dLux

PS: I think  Gtk::GladeXML module is a lot faster than  PyGlade! It is
very  good,  and  increases  the  chance for  it  to  be  on  handheld
computers.  Currently  pyGtk  and  pyGlade  _is_  on  the  iPAQ  Linux
distro, but I  think perl is more  suitable for this. I  want to thank
you if you help me to put perl+Gtk into iPAQ.
--
This Message is Powered by VI


----- End forwarded message -----

dLux
--
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)




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