Subject: | Segmentation fault after calling Gtk3::Menu::popup |
After creating a new Gtk3::Menu and calling $Menu->popup(), the program
segfaults. It appears to be happening when $Menu goes out of scope. I've
gathered as much information as I can.
Versions
--------
Ubuntu Desktop 12.04
Perl 5.14.2
Glib 1.253 (originally encountered on 1.241)
Glib::Object::Introspection 0.008
Gtk3 0.005
gobject-introspection-1.0 1.32.0
Test Program
------------
#!/usr/bin/perl
use warnings;
use strict;
use Gtk3 '-init';
my $Toplevel = Gtk3::Window->new('toplevel');
$Toplevel->signal_connect('destroy' => sub {
my ($self) = @_;
$self->destroy();
Gtk3->main_quit();
});
my $Button = Gtk3::Button->new('Click here');
$Button->signal_connect('button-press-event' => sub {
my ($self, $event) = @_;
my $Menu = Gtk3::Menu->new();
$Menu->popup(undef, undef, undef, undef, $event->button->{button},
$event->button->{time});
});
$Toplevel->add($Button);
$Toplevel->show_all();
Gtk3->main();
Backtrace
---------
#0 0x00007fe201f8ad88 in g_callable_info_free_closure () from
/usr/lib/../lib/libgirepository-1.0.so.1
#1 0x00007fe2021b17c8 in release_perl_callback (data=0x1efd080) at
gperl-i11n-callback.c:70
#2 0x00007fe2010f4848 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#3 0x00007fe20311aca2 in g_closure_invoke () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4 0x00007fe20312bc31 in ?? () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5 0x00007fe203134099 in g_signal_emit_valist () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6 0x00007fe203134242 in g_signal_emit () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7 0x00007fe201214fce in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#8 0x00007fe20311fe0d in g_object_unref () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9 0x00007fe20313f7a3 in g_value_unset () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007fe2031340cf in g_signal_emit_valist () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x00007fe203134242 in g_signal_emit () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007fe201214f9e in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#13 0x00007fe20311fe0d in g_object_unref () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#14 0x00007fe20337d932 in XS_Glib__Object_DESTROY (my_perl=<optimized
Show quoted text
out>, cv=<optimized out>) at GObject.xs:1279
#15 0x00007fe206c867ff in Perl_pp_entersub () from /usr/lib/libperl.so.5.14
#16 0x00007fe206c19762 in Perl_call_sv () from /usr/lib/libperl.so.5.14
#17 0x00007fe206c8cb70 in Perl_sv_clear () from /usr/lib/libperl.so.5.14
#18 0x00007fe206c8d272 in Perl_sv_free2 () from /usr/lib/libperl.so.5.14
#19 0x00007fe206cb50f8 in Perl_leave_scope () from /usr/lib/libperl.so.5.14
#20 0x00007fe206c84f37 in Perl_pp_leavesub () from /usr/lib/libperl.so.5.14
#21 0x00007fe206c7dc96 in Perl_runops_standard () from
/usr/lib/libperl.so.5.14
#22 0x00007fe206c1959e in Perl_call_sv () from /usr/lib/libperl.so.5.14
#23 0x00007fe20338167c in gperl_closure_marshal (closure=0x1ea7810,
return_value=0x7fffe2a2cde0, n_param_values=<optimized out>,
param_values=<optimized out>, invocation_hint=<optimized out>,
marshal_data=<optimized out>) at GClosure.xs:140
#24 0x00007fe20311aca2 in g_closure_invoke () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007fe20312bd71 in ?? () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007fe203133d7e in g_signal_emit_valist () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007fe203134242 in g_signal_emit () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007fe20120b779 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#29 0x00007fe2010de1db in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007fe2010dfef1 in gtk_main_do_event () from
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007fe200d2fd12 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#32 0x00007fe202e5dc9a in g_main_context_dispatch () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007fe202e5e060 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007fe202e5e45a in g_main_loop_run () from
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007fe2010df25d in gtk_main () from
/usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#36 0x00007fe202c13a14 in ffi_call_unix64 () from
/usr/lib/x86_64-linux-gnu/libffi.so.6
#37 0x00007fe202c13435 in ffi_call () from
/usr/lib/x86_64-linux-gnu/libffi.so.6
#38 0x00007fe2021b700a in invoke_callable (info=<optimized out>,
func_pointer=0x7fe2010df1d0, sp=0x1347750, ax=1, items=4,
internal_stack_offset=<optimized out>, mark=<optimized out>)
at gperl-i11n-invoke-c.c:163
#39 0x00007fe2021b7a65 in XS_Glib__Object__Introspection_invoke
(my_perl=<optimized out>, cv=<optimized out>) at GObjectIntrospection.xs:706
#40 0x00007fe206c867ff in Perl_pp_entersub () from /usr/lib/libperl.so.5.14
#41 0x00007fe206c7dc96 in Perl_runops_standard () from
/usr/lib/libperl.so.5.14
#42 0x00007fe206c1f33a in perl_run () from /usr/lib/libperl.so.5.14
#43 0x0000000000400db9 in main ()