cursor for display segv



The program below gets a segv for me with i386 debian "experimental" gtk
2.22 and glib 2.27.3.

It's a GdkDisplay with a cursor created on that display, and the display
destroyed before the cursor.  Looks like the segv is at the "undef $c"
stage, with gdb per below.

I wonder if gdk_cursor_unref() is not happy that the GdkDisplay of that
cursor has been destroyed.  If you destroy the display then do all the
cursors become invalid?  Is that something the perl bindings should
watch out for, or a gtk bug, or merely "don't do that"?

I thought I had a bit like this in my widget cursor tests without a
problem through to gtk 2.20, but maybe it only passed by happy chance.

#0  0xb771aef6 in XFreeCursor () from /usr/lib/libX11.so.6
#1  0xb6e8f502 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#2  0xb6e5e98a in gdk_cursor_unref () from /usr/lib/libgdk-x11-2.0.so.0
#3  0xb7b5a1d2 in ?? () from /usr/lib/libgobject-2.0.so.0
#4  0xb7b3b167 in g_boxed_free () from /usr/lib/libgobject-2.0.so.0
#5  0xb7b9ad34 in ?? () from /usr/lib/perl5/auto/Glib/Glib.so
#6  0xb7b9a942 in XS_Glib__Boxed_DESTROY ()
   from /usr/lib/perl5/auto/Glib/Glib.so
#7  0x080d5d7b in Perl_pp_entersub ()
#8  0x08078bb8 in Perl_call_sv ()
#9  0x080e8090 in Perl_sv_clear ()
#10 0x080e87da in Perl_sv_free2 ()
#11 0x08102b8f in Perl_free_tmps ()
#12 0x080d7495 in Perl_pp_nextstate ()
#13 0x080d4358 in Perl_runops_standard ()
#14 0x08079472 in perl_run ()
#15 0x080642fd in main ()

use strict;
use warnings;
use Gtk2;

my $d = Gtk2::Gdk::Display->open (':0');
my $c = Gtk2::Gdk::Cursor->new_for_display ($d,'hand1');
$d->close;
print "undef d\n";
undef $d;
print "cursor is:\n";
print "  $c\n";
undef $c;
print "exit now\n";
exit 0;


-- 
Bring out yer dead!


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