Skip Menu |
 

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 16053
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: zentara [...] zentara.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 804.027
Fixed in: (no value)



Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Subject: gtk2 > 2.8.0 apps are causing segfaults in Tk , with readv(3, [{"_GTK_LOAD_ICONTHEMES", 20},
X-RT-Original-Encoding: iso-8859-1
Content-Length: 954
Download (untitled) / with headers
text/plain 954b
Start any Perl/Tk app. If you have gtk+-2.8.7 installed, run gtk-demo. Click on Button Boxes to run it's demo, the Perl/Tk app will segfault. If you restart the Perl/Tk app, subsequent clicking of Button Box will NOT segfault Tk. Only the first time does it. I ran strace on the Perl/Tk apps, and when it segfaults, the line readv(3, [{"_GTK_LOAD_ICONTHEMES", 20}, {"", 0}], 2) = 20 always appears in strace before the crash. When I revert to earlier Gtk2 versions, say 2.8.0, it does not occur. I first noticed this when getting mail with sylpheed-claws would crash my running Tk apps. It does NOT crash Tcl/Tk apps, so it must be in the Perl/Tk conversion. I have seen this on ICEWM and KDE under OpenSuSE 10, and on my customized Slackware system, running the very latest libraries...glibc2.3.6, gcc-4.02, latest gtk+ libs. I have reported this to the gtk2 people, but they claim that it is a Perl/Tk bug since it is the Tk program which crashes.
Return-Path: <nick [...] ing-simmons.net>
X-Original-To: bug-Tk [...] rt.cpan.org
Delivered-To: cpan-bug+tk [...] diesel.bestpractical.com
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 3D53E4D8347 for <bug-Tk [...] rt.cpan.org>; Wed, 30 Nov 2005 14:29:01 -0500 (EST)
Received: (qmail 12773 invoked by alias); 30 Nov 2005 19:28:38 -0000
X-Spam-Check-BY: la.mx.develooper.com
Received-SPF: neutral (x1.develooper.com: local policy)
Received: from he304war.uk.vianw.net (HELO he304war.uk.vianw.net) (195.102.244.167) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 30 Nov 2005 11:28:29 -0800
Received: from [193.195.178.25] (helo=llama.ing-simmons.net) by he304war.uk.vianw.net with asmtp (Exim 4.20) id 1EhXcr-00074u-Bm for bug-Tk [...] rt.cpan.org; Wed, 30 Nov 2005 19:28:21 +0000
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: Id: //depot/mail/tkmail#145 /Perl5.008006 Mail::Internet v1.62
Subject: Re: [cpan #16053] gtk2 > 2.8.0 apps are causing segfaults in Tk ,with readv(3, [{"_GTK_LOAD_ICONTHEMES", 20},
In-Reply-To: <rt-16053-47728.8.37423232570124 [...] cpan.org> from Guest via RT on Wed, 23 Nov 2005 07:59:59 -0500 (EST)
References: <rt-16053-47728.8.37423232570124 [...] cpan.org>
Content-Type: text/plain; charset="UTF-8"
To: bug-Tk [...] rt.cpan.org
Message-ID: <20051130192820.15633.1 [...] llama.ing-simmons.net>
Date: Wed, 30 Nov 2005 19:28:20 +0000
Sender: Nick Ing-Simmons <nick [...] ing-simmons.net>
From: Nick Ing-Simmons <nick [...] ing-simmons.net>
Reply-To: Nick Ing-Simmons <nick [...] ing-simmons.net>
RT-Send-Cc:
Content-Length: 1639
Download (untitled) / with headers
text/plain 1.6k
Guest via RT <bug-Tk@rt.cpan.org> writes: Show quoted text
>This message about Tk was sent to you by guest <> via rt.cpan.org > >Full context and any attached attachments can be found at: <URL: >https://rt.cpan.org/Ticket/Display.html?id=16053 > > >Start any Perl/Tk app. If you have gtk+-2.8.7 installed, run gtk-demo. Click >on Button Boxes to run it's demo, the Perl/Tk app will segfault. If you >restart the Perl/Tk app, subsequent clicking of Button Box will NOT segfault >Tk. Only the first time does it. I ran strace on the Perl/Tk apps, and when it >segfaults, the line readv(3, [{"_GTK_LOAD_ICONTHEMES", 20}, {"", 0}], 2) = 20 >always appears in strace before the crash. When I revert to earlier Gtk2 >versions, say 2.8.0, it does not occur. I first noticed this when getting mail >with sylpheed-claws would crash my running Tk apps. It does NOT crash Tcl/Tk >apps, so it must be in the Perl/Tk conversion. I have seen this on ICEWM and >KDE under OpenSuSE 10, and on my customized Slackware system, running the very >latest libraries...glibc2.3.6, gcc-4.02, latest gtk+ libs. I have reported >this to the gtk2 people, but they claim that it is a Perl/Tk bug since it is >the Tk program which crashes.
As one toolkit is crashing another my guess is that GTK has put something in a X Property that per/Tk does not like. As it is a SEGV I am guessing that something that has been marked as a 32-bit property (or perhaps perk/Tk has _assumed_ is 32 bit) has a number of bytes which isn't a multiple of 4. Is file handle 3 that is being readv()ed the X socket (further back strace). Or as it SEGVs if by chance you can get a backtrace from gdb
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: iso-8859-1
Content-Length: 1015
Download (untitled) / with headers
text/plain 1015b
Thanks for more-of the strace. As both read/write are happening to fd=4 (number changed in last post) it is likely the X socket, but if you still have the _full_ trace to hand if you can look for a call like: socket(PF_FILE, SOCK_STREAM, 0) = 4 to confirm that it might help. How do I tell which version of gtk2 I have? This seems to suggest I have 2.4.9 ? nick@llama:/home/p4work/Tkutf8> grep -i version /opt/gnome/lib/pkgconfig/gtk+-2.0.pc gtk_binary_version=2.4.0 Version: 2.4.9 nick@llama:/home/p4work/Tkutf8> (I have SuSE9.2 + pile of online-updates, but SuSE don't use bleading edge.) Given that I seem to be way behind and not really a Gnome hacker I am reluctant to install anything as I don't know what goes where or depends on what. So gdb back trace would still be a help, But that really needs a perl (and hence a Tk) built with -g (I usually use -O2 -g) to be really helpful, but even function name trace you should get without -g may be a hint.
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: iso-8859-1
Content-Length: 415
Download (untitled) / with headers
text/plain 415b
Hmm, If I have read Xproto.h correctly read(4, "\241 b\16\1\0\300\0\306\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32) = 32 That is a ClientMessage Event \2xx is Event \41 = Decimal 33 = ClientMessage ' ' is just a padding byte b\16 is sequence number \1\0\300\0 is Window \0\306\1\0 is Atom which identifies Message So will take a look at what Tk does when it gets unexpected ClientMessage-s.
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: iso-8859-1
Content-Length: 624
Download (untitled) / with headers
text/plain 624b
1st attempt to fix: In tkGlue.c near line 4580 (in function LangClientMessage) is: if (!SvROK(w)) { Tk_Window mainwin = (Tk_Window)((((TkWindow*)tkwin)->mainPtr)->winPtr); w = TkToWidget(mainwin,NULL); } Please try changing that to if (!SvROK(w) && tkwin) { Tk_Window mainwin = (Tk_Window)((((TkWindow*)tkwin)->mainPtr)->winPtr); w = TkToWidget(mainwin,NULL); } I suspect gtk is sending the "_GTK_LOAD_ICON_THEME" message to one of perl/Tk's X windows which don't correspond to Tk widgets. So core Tk has failed to find a "tkwin" and perl glue code's attempt to locate MainWindow is doomed.
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
From: Ben Crowell
X-RT-Original-Encoding: iso-8859-1
Content-Length: 141
Download (untitled) / with headers
text/plain 141b
Show quoted text
> if (!SvROK(w) && tkwin)
I've applied this patch, and it doesn't fix the problem. According to gdb, the crash is inside Tk_HandleEvent().
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
From: Ben Crowell
X-RT-Original-Encoding: iso-8859-1
Content-Length: 441
Download (untitled) / with headers
text/plain 441b
The following patch to tkEvent.c cures the crashes: if (eventPtr && winPtr && winPtr->mainPtr) { LangClientMessage(winPtr->mainPtr->interp, (Tk_Window) winPtr, eventPtr); } However, I don't know if the patch is sufficient, because I don't understand all the surrounding code. It could be that omitting the call to LangClientMessage causes a loss of integrity to Perl/Tk's data, for instance.
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
X-RT-Original-Encoding: iso-8859-1
Content-Length: 42
Latest patch has been confirmed as a fix.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: m_lin.nooning [...] comcast.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1854
Download (untitled) / with headers
text/plain 1.8k
On Thu Dec 29 07:48:14 2005, NI-S wrote: Show quoted text
> > Latest patch has been confirmed as a fix.
I added the patch. However, I still get a Segmentation Fault within 20 button clicks of the short script I am pasting below, on at least two Linux variants. Doing a Google search for "Segmentation fault after destroying non-dependent window" will reveal that this is a problem on a number of Linux platforms. It works fine on Windows. #!/usr/bin/perl -w # File test_pop_up_a_message.pl 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 Segmentation fault within 20 clicks of Okay \n " . $count++ . "\n"; pop_up_a_message($message); print ("You pressed $answer\n"); }
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-17675-1140789290-475.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: zentara [...] zentara.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 756
Download (untitled) / with headers
text/plain 756b
On Fri Feb 24 06:41:12 2006, guest wrote: Show quoted text
> On Thu Dec 29 07:48:14 2005, NI-S wrote:
> > > > Latest patch has been confirmed as a fix.
> > I added the patch. However, I still get a Segmentation Fault within 20 > button clicks of the short script I am pasting below, on at least two > Linux variants. Doing a Google search for "Segmentation fault after > destroying non-dependent window" will reveal that this is a problem on a > number of Linux platforms. It works fine on Windows.
Hi, I think you posted this bug under the wrong category. This bug thread was caused by Gtk2 apps interfering with Tk. Your problem dosn't even mention Gtk2. By the way, I ran your script without any segfaults, many times. I'm using linux on a customized slackware.
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-17666-1140791857-166.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: zentara [...] zentara.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 824
Download (untitled) / with headers
text/plain 824b
On Fri Feb 24 06:41:12 2006, guest wrote: Show quoted text
> On Thu Dec 29 07:48:14 2005, NI-S wrote:
> > > > Latest patch has been confirmed as a fix.
> > I added the patch. However, I still get a Segmentation Fault within 20 > button clicks of the short script I am pasting below, on at least two > Linux variants. Doing a Google search for "Segmentation fault after > destroying non-dependent window" will reveal that this is a problem on a > number of Linux platforms. It works fine on Windows. > >
Oops, sorry for the premature dismissal...... I did finally see your bug. And there is a mention of readv(3, [{"2400001 gTK_LOAD_ICONTHEMES\ in the strace output lines preceding the segfault. So I guess that this bug has not been fully worked out. I'll try to start up my debugging version of Tk, and see where it is crashing.
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-17675-1140795259-365.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: zentara [...] zentara.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1654
Download (untitled) / with headers
text/plain 1.6k
On Fri Feb 24 06:41:12 2006, guest wrote: Show quoted text
> On Thu Dec 29 07:48:14 2005, NI-S wrote:
> > > > Latest patch has been confirmed as a fix.
> > I added the patch. However, I still get a Segmentation Fault within 20 > button clicks of the short script I am pasting below, on at least two > Linux variants. Doing a Google search for "Segmentation fault after > destroying non-dependent window" will reveal that this is a problem on a > number of Linux platforms. It works fine on Windows.
This is the output of a debugging Tk, with the tkEvent.c patch applied, when I run you script. 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 0xb7d1861f in Tk_GetOptionValue () from /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi-ld/auto/Tk/Tk.so #1 0xb7cc723a in FrameWidgetObjCmd () from /usr/lib/perl5/site_perl/5.8.7/i686-linux-thread-multi-ld/auto/Tk/Tk.so #2 0xb7c95d06 in Call_Tk (info=0x83d87b8, items=3, args=0x825a184) at tkGlue.c:2283 #3 0xb7c9729c in XStoWidget (my_perl=0x8154f68, cv=0x8290534) at tkGlue.c:2662 #4 0x080c6aa1 in Perl_pp_entersub () #5 0x080bf309 in Perl_runops_standard () #6 0x08064a7b in perl_run () #7 0x0805fe5d in main () (gdb) q ######################################################## Maybe Nick Ing Simmons will know what changes need to be made.
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-17675-1140795259-365.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-17675-1140795259-365.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-3289-1141229495-1987.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: m.nooning [...] comcast.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 378
Download (untitled) / with headers
text/plain 378b
There is another clue from where I submitted this bug to the (now closed) bugzilla report at http://bugzilla.gnome.org/show_bug.cgi?id=332989 I had included the already shown short script and stack trace. There, a Matthias Clasen replied: ----paste Tk bug. It must not segfault on receiving a ClientMessage ----end paste Does Matthias' statement add a helpful clue to anyone?
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-3289-1141229495-1987.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-17675-1140795259-365.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-3289-1141229495-1987.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-32148-1141244767-941.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: zentara [...] zentara.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 2216
Download (untitled) / with headers
text/plain 2.1k
On Wed Mar 01 11:11:35 2006, guest wrote: Show quoted text
> There is another clue from where I submitted this bug to the (now > closed) bugzilla report at > http://bugzilla.gnome.org/show_bug.cgi?id=332989 > I had included the already shown short script and stack trace. > > There, a Matthias Clasen replied: > ----paste > Tk bug. It must not segfault on receiving a ClientMessage > ----end paste > > Does Matthias' statement add a helpful clue to anyone?
Well Matthias' response was directed to the original bug, which is the bug originally discussed in this thread. I posted this problem to the Gtk buglist, and they responded, that no matter if Gtk was involved in causing the segfault, it was a Tk problem....because Tk should not be responding to Gtk's window manager signals. That problem was apparently fixed to my (and others) satisfaction by the patch. Since patching, I've not seen any segfaults, and I run alot of Tk and Gtk2 code. Your program does indeed raise the spector that this bug is not totally fixed....i.e. there probably is another place in the code which needs patching. I cannot easily see where, from the results of my backtrace. It will take the mind of Nick Ing Simmons, with his more intimate knowledge. Furthermore, your particular code segfaults on it's own, not as a result of something in a gtk2 app. In the original bug, a button press in a Gtk2 app, would kill ALL running Tk programs. Your code snippet only kills itself, so it is a different type of problem. Additionally, your example snippet itself may be causing it, by the way it is written. All I can say, is that I have not seen any problem with this bug since the patch, with the exception of your code. I also posted it on comp.lang.perl.tk, and no one else is complaining about noticing it. Sooo........in summary, I think it is a different bug, (although there is a similarity in the gtk_load_iconthemes appearing in the strace output before the crash. The main differences between your new bug and the original is.... 1. Your code kills itself and only itself, where in the original bug, a button click in a gtk2 app would kill ALL running Tk apps. 2. Nobody is reporting seeing the bug, except when running your test code.
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-3289-1141229495-1987.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-17675-1140795259-365.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-3289-1141229495-1987.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-32130-1141246557-1388.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: zentara [...] zentara.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1258
Download (untitled) / with headers
text/plain 1.2k
On Wed Mar 01 11:11:35 2006, guest wrote: Show quoted text
> There is another clue from where I submitted this bug to the (now > closed) bugzilla report at > http://bugzilla.gnome.org/show_bug.cgi?id=332989 > I had included the already shown short script and stack trace. > > There, a Matthias Clasen replied: > ----paste > Tk bug. It must not segfault on receiving a ClientMessage > ----end paste > > Does Matthias' statement add a helpful clue to anyone?
Hi, just an addendum, to explain why I think it may actually be the way you wrote your code snippet, which is causing the segfaults. The way you create a new mainwindow and event loop in a subroutine, and repeatedly call that sub, is bound to lead to segfaults. You do not want to constantly be creating a new mainwindow and redefining the event loop from a sub. If you do it that way, ( which you would never do in practice) you need to clean up after the old mainwindow and loop. In almost all programs, you want to create the mainwindow and event loop just once, and subsequent windows should be new toplevels, or dialogs. Without careful cleanup, the code can keep track of which mainwindow is the current, and which event loop is current. You are attempting a sort of infinite recursion with your code.
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-32130-1141246557-1388.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.5.HEAD-32130-1141248841-1981.16053-0-0 [...] rt.cpan.org>
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-17675-1140795259-365.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-3289-1141229495-1987.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-32130-1141246557-1388.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1505
Download (untitled) / with headers
text/plain 1.4k
There is a pertinent reason why the test code given is relevent. Besides just surfacing the bug. I have an application wherein the user makes a choice from a Perl/Tk pop up menu. Once a choice is made, the pop up is destroyed and something then runs in the background. When the user chosen task is done running, one of a number of different pop ups could happen, depending upon the results. One could be a pop up wherein the user is asked if he wants to run it again. Different home grown Perl modules have different pop ups. Most are very simple informational messages but they need to be popped up, and then destroyed when the user clicks an Okay button. Hence I really do need to be able to create a pop up in a routine, destroy it, create another one from another routine, destroy it, and so on. That is why the test code really does reflect the problem space. It runs just fine on Windows, by the way. No problems whatsoever on Windows. It is only the Linux varients that have the problem. I cannot imagine that Tk really has a problem with the concept of having a popup attempted multiple times. This has to be a bug that can be resolved. I do a careful cleanup each time the user clicks the Okay button by explicitly using the "destroy" method, such as $we_top->destroy. Isn't that supposed to destory MainWindow and take care of any needed cleanup? Shouldn't I then be free to call a routine that might (or might not) pop up a new message? Is there something I am missing?
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-32130-1141248841-1981.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <rt-3.5.HEAD-17635-1140781272-1670.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-17675-1140795259-365.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-3289-1141229495-1987.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-32130-1141246557-1388.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-32130-1141248841-1981.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-32166-1141250341-273.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: zentara [...] zentara.net
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1596
Download (untitled) / with headers
text/plain 1.5k
On Wed Mar 01 16:34:01 2006, guest wrote: Show quoted text
> There is a pertinent reason why the test code given is relevent. > Besides just surfacing the bug. > > I have an application wherein the user makes a choice from a Perl/Tk pop > up menu. Once a choice is made, the pop up is destroyed and something > then runs in the background. When the user chosen task is done running,
I don't want to carry on a design discussion in this Tk bug forum. All I can say is that there are many better ways to design what you are trying to do. The code is not more complicated, but it will run better. The approach you are taking seems logical to someone used to doing linear procedural programming, but gui programming involves a thing called the "event loop", and your method of design sort of ignores it's crucial role in running the gui. That is probably why you would get unpredictable results in the segfaults, sometimes a few clicks, sometimes 20. It starts depending on system load, and timing between clicks processing your rebuilding a new mainwindow. Finally , just running $mw->destroy does not clean up, because you are still attempting to use the old event-loop to launch the next event-loop, if the timing gets bad, it segfaults. Anyways, you can post this problem on comp.lang.perl.tk or at http://perlmonks.org and show your code, and explain exactly what you want to do. I will give my ideas, and others may have better solutions. But be assured, there are ways to do what you want, without causing a segfault, where only 1 mainwindow is created, and the rest is done thru toplevels or dialogs.
X-Scanned-BY: AMaViS-ng at bestpractical
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
In-Reply-To: <rt-3.5.HEAD-17666-1140791857-166.16053-5-0 [...] rt.cpan.org> from Guest via RT on Fri, 24 Feb 2006 09:37:40 -0500 (EST)
X-Mailer: Id: //depot/mail/tkmail#145 /Perl5.008007 Mail::Internet v1.62
Content-Disposition: inline
Received-SPF: pass (x1.develooper.com: local policy)
References: <RT-Ticket-16053 [...] rt.cpan.org><rt-3.5.HEAD-17635-1140781272-1670.16053-5-0 [...] rt.cpan.org><rt-3.5.HEAD-17666-1140791857-166.16053-5-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Reply-To: Nick Ing-Simmons <nick [...] ing-simmons.net>
X-RT-Original-Encoding: utf-8
Received: from localhost (localhost.localdomain [127.0.0.1]) by diesel.bestpractical.com (Postfix) with ESMTP id 433004D80BC for <cpan-bug+tk [...] diesel.bestpractical.com>; Sat, 11 Mar 2006 12:47:26 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id D34DF4D80BA for <bug-Tk [...] rt.cpan.org>; Sat, 11 Mar 2006 12:47:25 -0500 (EST)
Received: (qmail 18431 invoked by alias); 11 Mar 2006 17:47:23 -0000
Received: from Unknown (HELO llama.ing-simmons.net) (193.195.178.25) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 11 Mar 2006 09:47:16 -0800
Received: from llama.ing-simmons.net (localhost [127.0.0.1]) by llama.ing-simmons.net (Postfix) with ESMTP id 6DC964691D for <bug-Tk [...] rt.cpan.org>; Sat, 11 Mar 2006 17:47:09 +0000 (GMT)
Delivered-To: cpan-bug+tk [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #16053] gtk2 > 2.8.0 apps are causing segfaultsin Tk , with readv(3, [{"_GTK_LOAD_ICONTHEMES", 20},
Return-Path: <nick [...] ing-simmons.net>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+tk [...] diesel.bestpractical.com
Date: Sat, 11 Mar 2006 17:47:09 +0000
Sender: Nick Ing-Simmons <nick [...] ing-simmons.net>
Message-Id: <20060311174709.19943.17 [...] llama.ing-simmons.net>
To: bug-Tk [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Nick Ing-Simmons <nick [...] ing-simmons.net>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.5.HEAD-17512-1142099251-1799.16053-0-0 [...] rt.cpan.org>
Content-Length: 757
Download (untitled) / with headers
text/plain 757b
Guest via RT <bug-Tk@rt.cpan.org> writes: Show quoted text
><URL: http://rt.cpan.org/Ticket/Display.html?id=16053 > > >Oops, sorry for the premature dismissal...... I did finally see your >bug. And there is a mention of readv(3, [{"2400001 gTK_LOAD_ICONTHEMES\ > in the strace output lines preceding the segfault. So I guess that >this bug has not been fully worked out. I'll try to start up my >debugging version of Tk, and see where it is crashing.
I am not following all this yet, but the bug fix cannot stop Gtk sending the message - so message will still be read from the X socket, which is what the strace fragment shows. The bug fix causes Tk to ignore the message. The message likely gets sent by the window manager when a new top level window is created.
X-Source:
X-Scanned-BY: AMaViS-ng at bestpractical
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.5 required=8.0 tests=BAYES_00,FORGED_RCVD_HELO,SPF_PASS
In-Reply-To: <rt-3.5.HEAD-17512-1142099251-1799.16053-6-0 [...] rt.cpan.org>
X-Source-Args:
X-Mailer: Sylpheed-Claws 2.0.0 (GTK+ 2.8.14; i686-pc-linux-gnu)
X-Source-Dir:
Received-SPF: pass (x1.develooper.com: domain of zentara [...] zentara.net designates 69.16.197.52 as permitted sender)
References: <RT-Ticket-16053 [...] rt.cpan.org> <RT-Ticket-16053 [...] rt.cpan.org> <rt-3.5.HEAD-17635-1140781272-1670.16053-5-0 [...] rt.cpan.org> <rt-3.5.HEAD-17666-1140791857-166.16053-5-0 [...] rt.cpan.org> <20060311174709.19943.17 [...] llama.ing-simmons.net> <rt-3.5.HEAD-17512-1142099251-1799.16053-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
X-Antiabuse: This header was added to track abuse, please include it with any abuse report
X-Antiabuse: Primary Hostname - martin.dotcanada.com
X-Antiabuse: Original Domain - rt.cpan.org
X-Antiabuse: Originator/Caller UID/GID - [0 0] / [47 12]
X-Antiabuse: Sender Address Domain - zentara.net
X-RT-Original-Encoding: US-ASCII
Received: from localhost (localhost.localdomain [127.0.0.1]) by diesel.bestpractical.com (Postfix) with ESMTP id 901FF4D80E2 for <cpan-bug+tk [...] diesel.bestpractical.com>; Sun, 12 Mar 2006 06:05:16 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 364E84D80BA for <bug-Tk [...] rt.cpan.org>; Sun, 12 Mar 2006 06:05:16 -0500 (EST)
Received: (qmail 10986 invoked by alias); 12 Mar 2006 11:05:13 -0000
Received: from martin.genwebhost.com (HELO martin.dotcanada.com) (69.16.197.52) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sun, 12 Mar 2006 03:05:10 -0800
Received: from adsl-68-79-120-83.dsl.sfldmi.ameritech.net ([68.79.120.83]:60007 helo=zentara.zentara.net) by martin.dotcanada.com with esmtpa (Exim 4.52) id 1FIONm-0006PG-7F for bug-Tk [...] rt.cpan.org; Sun, 12 Mar 2006 06:05:06 -0500
Delivered-To: cpan-bug+tk [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #16053] gtk2 > 2.8.0 apps are causing segfaultsin Tk , with readv(3, [{"_GTK_LOAD_ICONTHEMES", 20},
Return-Path: <zentara [...] zentara.net>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+tk [...] diesel.bestpractical.com
X-Clamantivirus-Scanner: This mail is clean
Date: Sun, 12 Mar 2006 06:02:24 -0500
Message-Id: <20060312060224.480b0f33 [...] zentara.zentara.net>
To: bug-Tk [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: zentara <zentara [...] zentara.net>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.5.HEAD-6347-1142161522-805.16053-0-0 [...] rt.cpan.org>
Content-Length: 1176
Download (untitled) / with headers
text/plain 1.1k
On Sat, 11 Mar 2006 12:47:33 -0500 (EST) "Nick Ing-Simmons via RT" <bug-Tk@rt.cpan.org> wrote: Show quoted text
> ><URL: http://rt.cpan.org/Ticket/Display.html?id=16053 > > >Guest via RT <bug-Tk@rt.cpan.org> writes:
>><URL: http://rt.cpan.org/Ticket/Display.html?id=16053 > >> >>Oops, sorry for the premature dismissal...... I did finally see your >>bug. And there is a mention of readv(3, [{"2400001 gTK_LOAD_ICONTHEMES\ >> in the strace output lines preceding the segfault. So I guess that >>this bug has not been fully worked out. I'll try to start up my >>debugging version of Tk, and see where it is crashing.
> >I am not following all this yet, but the bug fix cannot stop >Gtk sending the message - so message will still be read from the X socket, >which is what the strace fragment shows. > >The bug fix causes Tk to ignore the message. > >The message likely gets sent by the window manager when a new top level >window is created. >
Don't worry about this one......it was caused by a bad program design, calling MainLoop multiple times from a sub. He has been shown the right way to write it. -- I'm not really a human, but I play one on earth. http://zentara.net/japh.html
MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-6347-1142161522-805.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
References: <RT-Ticket-16053 [...] rt.cpan.org> <RT-Ticket-16053 [...] rt.cpan.org> <rt-3.5.HEAD-17635-1140781272-1670.16053-5-0 [...] rt.cpan.org> <rt-3.5.HEAD-17666-1140791857-166.16053-5-0 [...] rt.cpan.org> <20060311174709.19943.17 [...] llama.ing-simmons.net> <rt-3.5.HEAD-17512-1142099251-1799.16053-6-0 [...] rt.cpan.org> <20060312060224.480b0f33 [...] zentara.zentara.net> <rt-3.5.HEAD-6347-1142161522-805.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-25006-1143463717-1985.16053-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1143463717-25006-6"
From: peter.willendrup [...] risoe.dk
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 437
Download (untitled) / with headers
text/plain 437b
Hello there, On Sun Mar 12 06:05:22 2006, zentara@zentara.net wrote: Show quoted text
> Don't worry about this one......it was caused by a bad program design, > calling MainLoop multiple times from a sub. He has been shown the
right way Show quoted text
> to write it.
I have similar behaviour of a perl-Tk based app which to the best of my knowledge does not call MainLoop multiple times from a sub. Please find attached output from a strace run. Peter Willendrup
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: multipart/mixed; boundary="----------=_1143463717-25006-5"
Content-Length: 0
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Type: text/x-log; name="strace.log"
Content-Disposition: inline; filename="strace.log"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
X-RT-Original-Encoding: ascii
Content-Length: 257783
Download strace.log
text/x-log 251.7k

Message body is not shown because it is too large.

MIME-Version: 1.0
In-Reply-To: <rt-3.5.HEAD-25006-1143463717-1985.16053-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <RT-Ticket-16053 [...] rt.cpan.org> <RT-Ticket-16053 [...] rt.cpan.org> <rt-3.5.HEAD-17635-1140781272-1670.16053-5-0 [...] rt.cpan.org> <rt-3.5.HEAD-17666-1140791857-166.16053-5-0 [...] rt.cpan.org> <20060311174709.19943.17 [...] llama.ing-simmons.net> <rt-3.5.HEAD-17512-1142099251-1799.16053-6-0 [...] rt.cpan.org> <20060312060224.480b0f33 [...] zentara.zentara.net> <rt-3.5.HEAD-6347-1142161522-805.16053-0-0 [...] rt.cpan.org> <rt-3.5.HEAD-25006-1143463717-1985.16053-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.5.HEAD-25006-1143464181-1473.16053-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: peter.willendrup [...] risoe.dk
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 258
Download (untitled) / with headers
text/plain 258b
On Mon Mar 27 07:48:37 2006, guest wrote: Show quoted text
> I have similar behaviour of a perl-Tk based app which to the best of my > knowledge does not call MainLoop multiple times from a sub.
Oops. Feel free to close the bug, my mistake - patch fixes my problem. Peter


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.