Skip Menu |

This queue is for tickets about the Gtk3 CPAN distribution.

Report information
The Basics
Id: 77339
Status: resolved
Priority: 0/
Queue: Gtk3

People
Owner: Nobody in particular
Requestors: drashian [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.005
Fixed in: (no value)



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 ()
On Mon May 21 17:08:07 2012, bronzewing wrote: Show quoted text
> After creating a new Gtk3::Menu and calling $Menu->popup(), the program > segfaults. It appears to be happening when $Menu goes out of scope.
This was recently fixed by this commit in Glib::Object::Introspection: <http://git.gnome.org/browse/perl-Glib-Object-Introspection/commit/?id=8d88bddf6eb7e5e85567ad0a7bd896a0f8f7b029>. It is in the recently-released version 0.009. Let us know if this doesn't fix your problem.
From: drashian [...] gmail.com
On Mon May 21 18:48:31 2012, TSCH wrote: Show quoted text
> On Mon May 21 17:08:07 2012, bronzewing wrote:
> > After creating a new Gtk3::Menu and calling $Menu->popup(), the
> program
> > segfaults. It appears to be happening when $Menu goes out of scope.
> > This was recently fixed by this commit in Glib::Object::Introspection: > <http://git.gnome.org/browse/perl-Glib-Object- > Introspection/commit/?id=8d88bddf6eb7e5e85567ad0a7bd896a0f8f7b029>. > It is in the recently-released version 0.009. > > Let us know if this doesn't fix your problem.
Confirmed fixed, thanks! Now I'm seeing a closely-related issue that this masked before: My menu is being destroyed as soon as I pop it up, because I wasn't keeping any references to it. I've restored the expected (correct?) behavior in my program by adding: $Menu->signal_connect('selection-done' => sub { $Menu->destroy(); }); But I don't know if that's an ideal fix or not.
On Tue May 22 09:55:09 2012, bronzewing wrote: Show quoted text
> Confirmed fixed, thanks! Now I'm seeing a closely-related issue that > this masked before: My menu is being destroyed as soon as I pop it up, > because I wasn't keeping any references to it. I've restored the > expected (correct?) behavior in my program by adding: > > $Menu->signal_connect('selection-done' => sub { > $Menu->destroy(); > }); > > But I don't know if that's an ideal fix or not.
Looks good to me.