Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 2689
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: david.boerschlein [...] pb.com
Cc:
AdminCc:

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



Subject: Bus error using TK 800.024 on Solaris 5.8
I am using Perl/Tk on Solaris 5.8 with Perl 5.8.0 and Tk 800.024. Complete version information is listed at the end of this post. I am getting a bus error when exiting the program from a secondary perl module. I have reproduced this problem in a small "Hello World" program. Here is the source code: HelloWorldBusError.pl: #!/bin/perl use strict; use integer; use Tk; use OwnModule; sub doit() { OwnModule::callExit(0); } my $main = new MainWindow; $main->Label(-text => 'Hello World')->pack; $main->Button(-text => 'Quit', -command => sub{print "goodbye world!\n"; doit();})->pack; MainLoop; OwnModule.pm: #!/usr/bin/perl -w package OwnModule; use strict; use integer; sub callExit($) { my $rc = shift(); exit($rc); } 1; Here is the stack trace from gdb (ddd): (gdb) run -w ./HelloWorldBusError.pl goodbye world! Program received signal SIGSEGV, Segmentation fault. 0xff04f608 in TkEventDeadWindow () from /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Tk/Tk.so (gdb) up #1 0xff081ae0 in Tk_DestroyWindow () from /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Tk/Tk.so (gdb) up #2 0xff08196c in Tk_DestroyWindow () from /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Tk/Tk.so (gdb) up #3 0xff04ad68 in Tk_DestroyCmd () from /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Tk/Tk.so (gdb) up #4 0xff02c968 in Call_Tk () from /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Tk/Tk.so (gdb) up #5 0xff02e594 in XStoTk () from /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Tk/Tk.so (gdb) up #6 0xff0341a8 in XS_Tk_destroy () from /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/auto/Tk/Tk.so (gdb) up #7 0x7d310 in Perl_pp_entersub () (gdb) up #8 0x75784 in Perl_runops_standard () (gdb) up #9 0x27fa4 in S_call_body () (gdb) up #10 0x27c9c in Perl_call_sv () (gdb) up #11 0x2b560 in S_call_list_body () (gdb) up #12 0x2b10c in Perl_call_list () (gdb) up #13 0x25068 in perl_destruct () (gdb) up #14 0x240ac in main () (gdb) up Initial frame selected; you cannot go up. (gdb) #-------------------------------------------------------------------------- $ /bin/perl -v This is perl, v5.8.0 built for sun4-solaris Copyright 1987-2002, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. #-------------------------------------------------------------------------- $ uname -a SunOS rscdoc2 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Fire-880 #-------------------------------------------------------------------------- $ fgrep -i version \ $(find $(dump_perl_inc_array) -type f -name '*.pm' | fgrep Tk) | \ cut -d'/' -f8- | fgrep -v 'use vars' | cut -d# -f1 | \ grep ':.*[0-9]' | sort -u sun4-solaris/Tk.pm:$Tk::version = '8.0'; sun4-solaris/Tk.pm:$Tk::VERSION = '800.024'; sun4-solaris/Tk/Adjuster.pm:$VERSION = '3.025'; sun4-solaris/Tk/After.pm:$VERSION = '3.015'; sun4-solaris/Tk/Animation.pm:$VERSION = '3.020'; sun4-solaris/Tk/Balloon.pm:$VERSION = '3.037'; sun4-solaris/Tk/Bitmap.pm:$VERSION = '3.010'; sun4-solaris/Tk/BrowseEntry.pm:$VERSION = '3.030'; sun4-solaris/Tk/Button.pm:$VERSION = '3.014'; sun4-solaris/Tk/Canvas.pm:$VERSION = '3.018'; sun4-solaris/Tk/Checkbutton.pm:$VERSION = '3.011'; sun4-solaris/Tk/Clipboard.pm:$VERSION = '3.016'; sun4-solaris/Tk/CmdLine.pm:$VERSION = '3.030'; sun4-solaris/Tk/ColorEditor.pm:$VERSION = '3.032'; sun4-solaris/Tk/Compound.pm:$VERSION = '3.004'; sun4-solaris/Tk/Config.pm:$VERSION = '800.024'; sun4-solaris/Tk/Configure.pm:$VERSION = '3.010'; sun4-solaris/Tk/demos/LabEnLabRad.pm:$VERSION = '3.006'; sun4-solaris/Tk/demos/widget_lib/Ball.pm:$VERSION = '3.009'; sun4-solaris/Tk/demos/widget_lib/Plot.pm:$VERSION = '3.013'; sun4-solaris/Tk/demos/widget_lib/WidgetDemo.pm:$VERSION = '3.021'; sun4-solaris/Tk/Derived.pm:$VERSION = '3.046'; sun4-solaris/Tk/Dialog.pm:$VERSION = '3.031'; sun4-solaris/Tk/DialogBox.pm:$VERSION = '3.032'; sun4-solaris/Tk/Dirlist.pm:$VERSION = '3.009'; sun4-solaris/Tk/DirTree.pm:$VERSION = '3.023'; sun4-solaris/Tk/DragDrop.pm:$VERSION = '3.029'; sun4-solaris/Tk/DragDrop/Common.pm:$VERSION = '3.014'; sun4-solaris/Tk/DragDrop/KDEDrop.pm:$VERSION = '3.007'; sun4-solaris/Tk/DragDrop/KDESite.pm:$VERSION = '3.007'; sun4-solaris/Tk/DragDrop/LocalDrop.pm:$VERSION = '3.005'; sun4-solaris/Tk/DragDrop/Rect.pm:$VERSION = '3.009'; sun4-solaris/Tk/DragDrop/SunConst.pm:$VERSION = '3.015'; sun4-solaris/Tk/DragDrop/SunDrop.pm: if ($version != 0) sun4-solaris/Tk/DragDrop/SunDrop.pm:$VERSION = '3.015'; sun4-solaris/Tk/DragDrop/SunSite.pm:$VERSION = '3.011'; sun4-solaris/Tk/DragDrop/XDNDDrop.pm:$VERSION = '3.009'; sun4-solaris/Tk/DragDrop/XDNDDrop.pm:sub XDND_PROTOCOL_VERSION () { 3 } sun4-solaris/Tk/DragDrop/XDNDSite.pm: $t->property('set','XdndAware','ATOM',32,[XDND_PROTOCOL_VERSION]); sun4-solaris/Tk/DragDrop/XDNDSite.pm:$VERSION = '3.010'; sun4-solaris/Tk/DragDrop/XDNDSite.pm:sub XDND_PROTOCOL_VERSION () { 3 } sun4-solaris/Tk/DropSite.pm:$VERSION = '3.021'; sun4-solaris/Tk/English.pm:$VERSION = '3.011'; sun4-solaris/Tk/Entry.pm:$VERSION = '3.037'; sun4-solaris/Tk/ErrorDialog.pm:$VERSION = '3.009'; sun4-solaris/Tk/Event.pm:$VERSION = '3.026'; sun4-solaris/Tk/Event.pm:$XS_VERSION = '800.024'; sun4-solaris/Tk/Event/IO.pm:$VERSION = '3.036'; sun4-solaris/Tk/FBox.pm:$VERSION = '3.020'; sun4-solaris/Tk/FileSelect.pm:$VERSION = '3.047'; sun4-solaris/Tk/FloatEntry.pm:$VERSION = '3.006'; sun4-solaris/Tk/Font.pm:$VERSION = '3.023'; sun4-solaris/Tk/Frame.pm:$VERSION = '3.031'; sun4-solaris/Tk/HList.pm:$VERSION = '3.037'; sun4-solaris/Tk/IconList.pm:$VERSION = '3.005'; sun4-solaris/Tk/Image.pm:$VERSION = '3.014'; sun4-solaris/Tk/InputO.pm:$VERSION = '3.013'; sun4-solaris/Tk/install.pm:$VERSION = '3.012'; sun4-solaris/Tk/IO.pm:$VERSION = '3.038'; sun4-solaris/Tk/ItemStyle.pm:$VERSION = '3.006'; sun4-solaris/Tk/JPEG.pm:$VERSION = '2.014'; sun4-solaris/Tk/Label.pm:$VERSION = '3.011'; sun4-solaris/Tk/LabEntry.pm:$VERSION = '3.011'; sun4-solaris/Tk/LabFrame.pm:$VERSION = '3.021'; sun4-solaris/Tk/LabRadio.pm:$VERSION = '3.009'; sun4-solaris/Tk/Listbox.pm:$VERSION = '3.033'; sun4-solaris/Tk/MainWindow.pm:$VERSION = '3.047'; sun4-solaris/Tk/MakeDepend.pm:$VERSION = '3.017'; sun4-solaris/Tk/Menu.pm:$VERSION = '3.045'; sun4-solaris/Tk/Menu/Item.pm:$VERSION = '3.027'; sun4-solaris/Tk/Menubar.pm:$VERSION = '3.015'; sun4-solaris/Tk/Menubutton.pm:$VERSION = '3.025'; sun4-solaris/Tk/Message.pm:$VERSION = '3.010'; sun4-solaris/Tk/MMtry.pm:$VERSION = '3.010'; sun4-solaris/Tk/MMutil.pm: s/(POD2MAN_EXE.*pod2man)/$1 --center "perl\/Tk Documentation" --release "Tk\$(VERSION)"/; sun4-solaris/Tk/MMutil.pm: s/(POD2MAN_EXE.*pod2man)/$1 -center "perl\/Tk Documentation" -release "Tk\$(VERSION)"/; sun4-solaris/Tk/MMutil.pm: s/(POD2MAN_EXE.*pod2man)/$1 -center \\"perl\/Tk Documentation\\" -release \\"Tk\$(VERSION)\\"/; sun4-solaris/Tk/MMutil.pm:$VERSION = '3.052'; sun4-solaris/Tk/Mwm.pm:$VERSION = '3.012'; sun4-solaris/Tk/NBFrame.pm:$VERSION = '3.013'; sun4-solaris/Tk/NoteBook.pm:$VERSION = '3.024'; sun4-solaris/Tk/Optionmenu.pm:$VERSION = '3.025'; sun4-solaris/Tk/Pane.pm:$VERSION = '3.008'; sun4-solaris/Tk/Photo.pm:$VERSION = '3.014'; sun4-solaris/Tk/Pixmap.pm:$VERSION = '3.011'; sun4-solaris/Tk/PNG.pm:$VERSION = '2.005'; sun4-solaris/Tk/Pretty.pm:$VERSION = '3.013'; sun4-solaris/Tk/ProgressBar.pm:$VERSION = '3.014'; sun4-solaris/Tk/Radiobutton.pm:$VERSION = '3.013'; sun4-solaris/Tk/Region.pm:$VERSION = '3.004'; sun4-solaris/Tk/Reindex.pm:$VERSION = '3.002'; sun4-solaris/Tk/ReindexedROText.pm:$VERSION = '3.002'; sun4-solaris/Tk/ReindexedText.pm:$VERSION = '3.002'; sun4-solaris/Tk/ROText.pm:$VERSION = '3.024'; sun4-solaris/Tk/Scale.pm:$VERSION = '3.012'; sun4-solaris/Tk/Scrollbar.pm:$VERSION = '3.014'; sun4-solaris/Tk/Stats.pm:$VERSION = '3.006'; sun4-solaris/Tk/Submethods.pm:$VERSION = '3.014'; sun4-solaris/Tk/Table.pm:$VERSION = '3.020'; sun4-solaris/Tk/Text.pm:$VERSION = '3.044'; sun4-solaris/Tk/Text/Tag.pm:$VERSION = '3.007'; sun4-solaris/Tk/TextEdit.pm:$VERSION = '3.004'; sun4-solaris/Tk/TextList.pm:$VERSION = '3.002'; sun4-solaris/Tk/TextUndo.pm:$VERSION = '3.050'; sun4-solaris/Tk/Tiler.pm:$VERSION = '3.016'; sun4-solaris/Tk/TixGrid.pm:$VERSION = '3.023'; sun4-solaris/Tk/TList.pm:$VERSION = '3.018'; sun4-solaris/Tk/Toplevel.pm:$VERSION = '3.028'; sun4-solaris/Tk/Trace.pm: . Version 1.0, for Tk800.022. sun4-solaris/Tk/Trace.pm:$VERSION = '3.002'; sun4-solaris/Tk/Tree.pm:$VERSION = '3.019'; sun4-solaris/Tk/Widget.pm:$VERSION = '3.080'; sun4-solaris/Tk/widgets.pm:$VERSION = '3.011'; sun4-solaris/Tk/WinPhoto.pm:$VERSION = '3.008'; sun4-solaris/Tk/Wm.pm:$VERSION = '3.023'; sun4-solaris/Tk/X.pm:$VERSION = '3.016'; sun4-solaris/Tk/X11Font.pm:$VERSION = '3.013'; sun4-solaris/Tk/Xlib.pm:$VERSION = '3.010'; sun4-solaris/Tk/Xrm.pm:$VERSION = '3.011'; Tk/JComboBox.pm:$VERSION = "0.02"; #--------------------------------------------------------------------------
[guest - Thu May 29 12:31:07 2003]: Show quoted text
> > I am using Perl/Tk on Solaris 5.8 with Perl 5.8.0 and Tk 800.024. > Complete version information is listed at the end of this post.
This is a known problem. If you call code from a Tk callback then that code needs to call Tk's exit. Perl's exit unwinds the C callstack using longjmp(). This leaves various Tk status structures pointing at the stack-frames which have been unwound. Tk's exit handles this by unwinding the Tk stack and then doing the perl thing. The work-round is thus: Show quoted text
> OwnModule.pm: > #!/usr/bin/perl -w > > package OwnModule; > use strict; > use integer;
use Tk qw(exit); # make exit() below be Tk::exit Show quoted text
> > sub callExit($) > { > my $rc = shift(); > exit($rc); > } > > 1; >