For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > March 2005 > Perl 5.8.6 Tk 8.4 run-time crash bug









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Perl 5.8.6 Tk 8.4 run-time crash bug
felix.da.ru

2005-03-23, 3:57 pm

Hi All,
I've discovered interesting bug - my Perl/Tk application
(see snippet below) crashes with nasty message:
=============== (example of M$ Win crash message) ==================
This application has requested the Runtime to terminate it in an
unusual way.
Please contact the application's support team for more information.
======================= (end example) ==============================
Any comments?

#!/usr/bin/perl -w

# This is a demo for Perl 5.8.6 Tk 8.4 run-time crash bug:
# When adding item to HList widget with method "add"
# and any of following parameters: -at/-before/-after
# the application crashes (win/linux)
# The same application work fine on Perl 5.6.1 Tk 8.0

use strict;
use Tk;
use Tk::Button;
use Tk::HList;

my $mw=MainWindow->new(-title=>'Perl 5.8.6 Tk 8.4 bug demo');

my $first = 'mw.first';

my $tf = $mw -> HList (-itemtype=>'text' )
-> pack(-anchor=>'nw', -pady=>5, -side=>'top', -padx=>5);
&Magic('mw');
&Magic($first);
foreach my $option(qw/-before -after -at/)
{
my @where = ($option=>($option eq '-at')?1:$first);

$mw -> Button ( -command=>[\&Magic,'mw.second_'.time()=>@where],
-text=>"Magic$option" )
-> pack(-pady=>5, -side=>'left', -padx=>5);
}

$mw -> Button ( -command=>sub {exit}, -text=>'Dismiss' )
-> pack(-pady=>5, -side=>'left', -padx=>5);

MainLoop;

#===vptk end===< DO NOT CODE ABOVE THIS LINE >===

sub Magic
{
my ($id,@where) = @_;
print "Magic: id=<$id> insert=<@where>\n";
$tf->add($id,@where,-text=>$id,-data=>$id);
}

felix.da.ru

2005-03-24, 8:57 am

Additional information for those who really dare to debug and fix - the
bug reproduced on earlier version of Perl/Tk:

Perl v5.8.4 build 810 for MSWin32-x86-multi-thread
C:\>perl -MTk -e "print $Tk::version"
8.4

I'll really appreciate your help,

Felix.

Marc Dashevsky

2005-03-24, 3:59 pm

In article <1111664739.798213.120330@o13g2000cwo.googlegroups.com>,
felix.liberman@gmail.com says...
> Additional information for those who really dare to debug and fix - the
> bug reproduced on earlier version of Perl/Tk:
>
> Perl v5.8.4 build 810 for MSWin32-x86-multi-thread
> C:\>perl -MTk -e "print $Tk::version"
> 8.4
>
> I'll really appreciate your help,


For what it's worth, your script does indeed crash on my Windows 2000
system.

This is perl, v5.8.6 built for MSWin32-x86-multi-thread
(with 3 registered patches, see perl -V for more detail)

Copyright 1987-2004, Larry Wall

Binary build 811 provided by ActiveState Corp. http://www.ActiveState.com
ActiveState is a division of Sophos.
Built Dec 13 2004 09:52:01

Z:\>perl -MTk -e "print $Tk::VERSION"
804.027

--
Go to http://MarcDashevsky.com to send me e-mail.
zentara

2005-03-25, 8:57 am

On Thu, 24 Mar 2005 07:46:28 -0500, Marc Dashevsky
<usenet@MarcDashevsky.com> wrote:

>In article <1111664739.798213.120330@o13g2000cwo.googlegroups.com>,
>felix.liberman@gmail.com says...
>
>For what it's worth, your script does indeed crash on my Windows 2000
>system.


It crashes on Linux too. Tk804.027

--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com