Segmentation fault in gtk2-perl-application



Hello everybody,

first of all, let me say "thank you!" for the great perl-bindings to gtk2. I 
very much enjoy using them and I'm happy with the progress I made with my 
first gtk2-perl application.

Unfortunately, I run into a segmentation fault at a specific point in my 
application. There is a menu-action that calls a certain subroutine; the 
segfault happens right after this sub has returned, so the application should 
normally just sit in the main loop and wait for signals.
The subroutine (called "loadDir") asks the user for a directory 
(Gtk2::FileChooserDialog), reads that directory and fills a tree and a list 
based on the contents of that directory (calling a bunch of other subs to 
perform those tasks). Sometimes, "loadDir" executes and everything is fine -  
but sometimes, the application segfaults after "loadDir" returned. For some 
directories, the segfault never happens.

According to muppets advice in 
http://mail.gnome.org/archives/gtk-perl-list/2003-July/msg00028.html, I built 
glib and gtk2 with the debugging flag and I'm now able to produce core dumps, 
but I'm not a C programmer and therefore really don't know what to do with 
them...

Is it at all possible that a bug in my own perl code (pure perl, nothing fancy 
at all) causes a segfault? Or am I just unhappy hitting a bug in the 
libraries?
Of course, I do much more trust the libraries than I trust my own code, but 
I'm only used to *dying* perl scripts (with file, line no. and error 
message); I never encountered a *segfault* with any perl script!?

I would be very glad if you could help me out with this issue by giving advice 
on where and how to start investigating what's going (wr)on(g) in my 
application. Of course, I am happy to provide you any information needed; not 
knowing what information might help, I only attached the output of gdb for a 
"bt" command.

Thank you very much in advance,

Stephan

This is gdb's output when I run "gdb perl core" after a segfault and enter 
"bt" at the prompt:

(gdb) bt
#0  0x40769d9c in gtk_path_bar_get_type () from /usr/lib/libgtk-x11-2.0.so.0
#1  0x402d6ddc in g_main_context_wakeup () from /usr/lib/libglib-2.0.so.0
#2  0x402d46c2 in g_main_depth () from /usr/lib/libglib-2.0.so.0
#3  0x402d5748 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4  0x402d5a80 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#5  0x402d6023 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#6  0x406ca796 in gtk_dialog_run () from /usr/lib/libgtk-x11-2.0.so.0
#7  0x40437b32 in XS_Gtk2__Dialog_run (my_perl=0x814c008, cv=0x82b4ce4) at 
GtkDialog.xs:330
#8  0x080c32d6 in Perl_pp_entersub ()
#9  0x080bbdc9 in Perl_runops_standard ()
#10 0x080640c9 in Perl_call_sv ()
#11 0x08063ec1 in Perl_call_sv ()
#12 0x40250c04 in gperl_closure_marshal (closure=0x842ca90, return_value=0x0, 
n_param_values=1, param_values=0xbfffea10, invocation_hint=0xbfffe8f8,
    marshal_data=0x40769d60) at GClosure.xs:106
#13 0x402846b6 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#14 0x40295ec8 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#15 0x40294f4c in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#16 0x402951e6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#17 0x40672c83 in _gtk_action_emit_activate () 
from /usr/lib/libgtk-x11-2.0.so.0
#18 0x406736ce in gtk_action_unblock_activate_from () 
from /usr/lib/libgtk-x11-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#19 0x402846b6 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#20 0x40295ec8 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#21 0x40294d3a in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#22 0x402951e6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#23 0x4066d71e in gtk_accel_group_activate () 
from /usr/lib/libgtk-x11-2.0.so.0
#24 0x4066d823 in gtk_accel_groups_activate () 
from /usr/lib/libgtk-x11-2.0.so.0
#25 0x408439df in gtk_window_activate_key () from /usr/lib/libgtk-x11-2.0.so.0
#26 0x408403dc in gtk_window_propagate_key_event () 
from /usr/lib/libgtk-x11-2.0.so.0
#27 0x407446de in _gtk_marshal_BOOLEAN__BOXED () 
from /usr/lib/libgtk-x11-2.0.so.0
#28 0x40284949 in g_cclosure_new_swap () from /usr/lib/libgobject-2.0.so.0
#29 0x402846b6 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#30 0x40295925 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#31 0x40294d3a in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#32 0x402951e6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#33 0x408338a7 in gtk_widget_send_expose () from /usr/lib/libgtk-x11-2.0.so.0
#34 0x4074329e in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#35 0x40742046 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#36 0x4093f815 in _gdk_events_queue () from /usr/lib/libgdk-x11-2.0.so.0
#37 0x402d46c2 in g_main_depth () from /usr/lib/libglib-2.0.so.0
#38 0x402d5748 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#39 0x402d5a80 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#40 0x402d6023 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#41 0x407418f3 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#42 0x40402942 in XS_Gtk2_main (my_perl=0x814c008, cv=0x8224434) at Gtk2.c:374
#43 0x080c32d6 in Perl_pp_entersub ()
#44 0x080bbdc9 in Perl_runops_standard ()
#45 0x080635e8 in perl_run ()
#46 0x080633f5 in perl_run ()
#47 0x0805fb9f in main ()



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