GNOME Bugzilla – Bug 332989
gtk2 > 2.8.0 apps are causing segfaults in Tk , with readv(3, [{"_GTK_LOAD_ICONTHEMES", 20},
Last modified: 2006-03-01 16:05:39 UTC
Steps to reproduce: 1. Run the short Perl/Tk script provided, which should have NOTHING TO DO with gtk 2. The script simply pops up a window, then destroys the window, in a loop, with each click of the Okay button. 3. The bug surfaces within 20 clicks of Okay. 4. Examine the supplied stack trace, stolen from someone else on URL http://rt.cpan.org/Public/Bug/Display.html?id=16053 The real question is, why would a simple Perl/Tk while loop consisting of create popup, destroy popup, create popup, destroy popup, etcetera, crash with something to do with Gtk? There seem to be a number of "help" URLs on this, including someone else's question: "Segmentation fault after destroying non-dependent window". That person has a different test script, but essentially the end bug crash is the same. Thanks -------paste #!/usr/bin/perl -w use Tk; use strict; our $answer = "okay"; ############ sub response { my ($we_top, $button_response) = @_; $we_top->destroy; $answer = $button_response; } ############ sub pop_up_a_message { my ($message) = @_; my $okay_button; my $exit_button; print("Can allways see\n"); my $we_top = new MainWindow; print("Cannot see if Segmentation fault\n"); $we_top->Label ( -text => $message)->pack(); #......... $okay_button = $we_top->Button( -text => 'Okay', -command => [ \&response, $we_top, 'okay' ] )->pack(); #......... $exit_button = $we_top->Button( -text => 'Exit', -command => [ \&response, $we_top, 'exit' ] )->pack(); #......... $we_top->MainLoop; } ############ my $message = ""; my $count = 1; while ($answer eq "okay") { $message = " On at least Slackware and Mandriva, Perl 5.8.7 or 5.8.8, this code will\n" . "get a gtk provided Segmentation fault within 20 clicks of Okay \n " . $count++ . "\n"; pop_up_a_message($message); print ("You pressed $answer\n"); } ---------end paste Stack trace: When running with a debugging Tk, with plain Perl 5.8.7 with original patch of tkEvent.c:986 if(interp){...} At segfault: ##################################################### Program received signal SIGSEGV, Segmentation fault. 0xb7d1861f in Tk_GetOptionValue () from /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi-ld/auto/Tk/Tk.so (gdb) bt
+ Trace 66604
######################################################## Other information:
Tk bug. It must not segfault on receiving a ClientMessage
Thanks. "It must not segfault on receiving a ClientMessage" is a good clue to this puzzle.