After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 332989 - gtk2 > 2.8.0 apps are causing segfaults in Tk , with readv(3, [{"_GTK_LOAD_ICONTHEMES", 20},
gtk2 > 2.8.0 apps are causing segfaults in Tk , with readv(3, [{"_GTK_LOAD_IC...
Status: RESOLVED NOTGNOME
Product: gtk+
Classification: Platform
Component: Widget: Other
2.8.x
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-03-01 13:26 UTC by M. Nooning
Modified: 2006-03-01 16:05 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description M. Nooning 2006-03-01 13:26:01 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
  • #0 Tk_GetOptionValue
    from /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi-ld/auto/Tk/Tk.so
  • #1 FrameWidgetObjCmd
    from /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi-ld/auto/Tk/Tk.so
  • #2 Call_Tk
    at tkGlue.c line 2283
  • #3 XStoWidget
    at tkGlue.c line 2662
  • #4 Perl_pp_entersub
  • #5 Perl_runops_standard
  • #6 perl_run
  • #7 main
########################################################


Other information:
Comment 1 Matthias Clasen 2006-03-01 13:43:48 UTC
Tk bug. It must not segfault on receiving a ClientMessage
Comment 2 M. Nooning 2006-03-01 16:05:39 UTC
Thanks.  "It must not segfault on receiving a ClientMessage" is a good clue to this puzzle.