Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

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

People
Owner: SREZIC [...] cpan.org
Requestors: romanroyer [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in:
  • 804.033_500
  • 804.034



Subject: NEW Tk: perl/Tk Problem with referenced variable in Entry
Date: Thu, 4 May 2017 11:07:43 -0600
To: bug-Tk [...] rt.cpan.org
From: Roman Royer <romanroyer [...] yahoo.com>
Distribution: Tk 804.033 Perl Version: 5.24.1 OS: Linux raroyer-lnx 2.6.18-400.1.1.el5 #1 SMP Sun Dec 14 06:01:17 EST 2014 x86_64 x86_64 x86_64 GNU/Linux This new bug is very similar to this previous bug: https://rt.cpan.org/Public/Bug/Display.html?id=90077 which had this test added: https://github.com/eserte/perl-tk/commit/f978a133908ef715233ace871919aff5aeb93254?diff=unified However, by changing just two lines in the test case, it fails in the latest perl/Tk. After tying a variable containing a float to an Entry box, NOT destroying the Entry box, and then multiplying the variable by 1.0, the variable is no longer treated as a float correctly. This does NOT fail on perl <= 5.16, but fails on perl >= 5.18, which corresponds to when perl #90077 was fixed. *Failing Test Case (slight modification of #90077 Test Case):* use strict; use Test::More 'no_plan'; use Tk; my $mw = tkinit; $mw->geometry('+0+0'); { # RT #90077 my $val = 0.20; { no warnings 'void'; $val * 2 } is $val * 1, 0.20; { my $tl = $mw->Toplevel; $tl->Entry(-textvariable => \$val)->pack; * #$tl->destroy; # Line Modified: Only fails if Toplevel is not destroyed* } * $val * 1.0; # Line Added: This causes $val to be incorrectly interpreted as integer in future operations* is $val * 1, 0.20 or do { require Devel::Peek; Devel::Peek::Dump($val) }; # pv_dump says: FLAGS = (PADMY,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) } __END__ *Test Case Output:* ok 1 not ok 2 # Failed test at test2.pl line 25. # got: '0' # expected: '0.2' SV = PVMG(0xf0ac0f0) at 0xe912070 REFCNT = 2 FLAGS = (GMG,SMG,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) IV = 0 NV = 0.2 PV = 0xf093cb0 "0.2"\0 [UTF8 "0.2"] CUR = 3 LEN = 32 MAGIC = 0xf093d10 MG_VIRTUAL = &PL_vtbl_uvar MG_TYPE = PERL_MAGIC_uvar(U) MG_LEN = 24 MG_PTR = 0xf0b2470 " \342C/\372*\0\0\300\vD/\372*\0\0\260;\f\17\0\0\0\0" 1..2 # Looks like you failed 1 test of 2.
On 2017-05-04 13:08:16, romanroyer@yahoo.com wrote: Show quoted text
> Distribution: Tk 804.033 > > Perl Version: 5.24.1 > > OS: Linux raroyer-lnx 2.6.18-400.1.1.el5 #1 SMP Sun Dec 14 06:01:17 > EST > 2014 x86_64 x86_64 x86_64 GNU/Linux > > > > This new bug is very similar to this previous bug: > https://rt.cpan.org/Public/Bug/Display.html?id=90077 > > which had this test added: > https://github.com/eserte/perl- > tk/commit/f978a133908ef715233ace871919aff5aeb93254?diff=unified > > However, by changing just two lines in the test case, it fails in the > latest perl/Tk. > > > After tying a variable containing a float to an Entry box, NOT > destroying > the Entry box, and then multiplying the variable by 1.0, the variable > is no > longer treated as a float correctly. This does NOT fail on perl <= > 5.16, > but fails on perl >= 5.18, which corresponds to when perl #90077 was > fixed. > > > *Failing Test Case (slight modification of #90077 Test Case):* > > use strict; > > use Test::More 'no_plan'; > > use Tk; > > > > my $mw = tkinit; > > $mw->geometry('+0+0'); > > > > { > > # RT #90077 > > my $val = 0.20; > > { no warnings 'void'; $val * 2 } > > is $val * 1, 0.20; > > > > { > > my $tl = $mw->Toplevel; > > $tl->Entry(-textvariable => \$val)->pack; > > * #$tl->destroy; # Line Modified: Only fails if Toplevel is not > destroyed* > > } > > > > * $val * 1.0; # Line Added: This causes $val to be incorrectly > interpreted as integer in future operations* > > > > is $val * 1, 0.20 or > > do { require Devel::Peek; Devel::Peek::Dump($val) }; # pv_dump says: > FLAGS = (PADMY,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) > > } > > > > __END__ > > > > *Test Case Output:* > > ok 1 > > not ok 2 > > # Failed test at test2.pl line 25. > > # got: '0' > > # expected: '0.2' > > SV = PVMG(0xf0ac0f0) at 0xe912070 > > REFCNT = 2 > > FLAGS = (GMG,SMG,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) > > IV = 0 > > NV = 0.2 > > PV = 0xf093cb0 "0.2"\0 [UTF8 "0.2"] > > CUR = 3 > > LEN = 32 > > MAGIC = 0xf093d10 > > MG_VIRTUAL = &PL_vtbl_uvar > > MG_TYPE = PERL_MAGIC_uvar(U) > > MG_LEN = 24 > > MG_PTR = 0xf0b2470 " > \342C/\372*\0\0\300\vD/\372*\0\0\260;\f\17\0\0\0\0" > > 1..2 > > # Looks like you failed 1 test of 2.
Confirmed. Can you check if commit fd52bd7 fixes the problem? git clone https://github.com/eserte/perl-tk cd perl-tk git checkout fd52bd7
Subject: Re: [rt.cpan.org #121528] AutoReply: NEW Tk: perl/Tk Problem with referenced variable in Entry
Date: Mon, 8 May 2017 08:49:03 -0600
To: bug-Tk [...] rt.cpan.org
From: Roman Royer <romanroyer [...] yahoo.com>
I verified that commit fd52bd7 in https://github.com/eserte/perl-tk DOES fix the problem in my specific use case. Thanks! On Thu, May 4, 2017 at 11:08 AM, Bugs in Tk via RT <bug-Tk@rt.cpan.org> wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "NEW Tk: perl/Tk Problem with referenced variable in Entry", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #121528]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=121528 > > Please include the string: > > [rt.cpan.org #121528] > > in the subject line of all future correspondence about this issue. To do > so, > you may reply to this message. > > Thank you, > bug-Tk@rt.cpan.org > > ------------------------------------------------------------------------- > Distribution: Tk 804.033 > > Perl Version: 5.24.1 > > OS: Linux raroyer-lnx 2.6.18-400.1.1.el5 #1 SMP Sun Dec 14 06:01:17 EST > 2014 x86_64 x86_64 x86_64 GNU/Linux > > > > This new bug is very similar to this previous bug: > https://rt.cpan.org/Public/Bug/Display.html?id=90077 > > which had this test added: > https://github.com/eserte/perl-tk/commit/f978a133908ef715233ace871919af > f5aeb93254?diff=unified > > However, by changing just two lines in the test case, it fails in the > latest perl/Tk. > > > After tying a variable containing a float to an Entry box, NOT destroying > the Entry box, and then multiplying the variable by 1.0, the variable is no > longer treated as a float correctly. This does NOT fail on perl <= 5.16, > but fails on perl >= 5.18, which corresponds to when perl #90077 was fixed. > > > *Failing Test Case (slight modification of #90077 Test Case):* > > use strict; > > use Test::More 'no_plan'; > > use Tk; > > > > my $mw = tkinit; > > $mw->geometry('+0+0'); > > > > { > > # RT #90077 > > my $val = 0.20; > > { no warnings 'void'; $val * 2 } > > is $val * 1, 0.20; > > > > { > > my $tl = $mw->Toplevel; > > $tl->Entry(-textvariable => \$val)->pack; > > * #$tl->destroy; # Line Modified: Only fails if Toplevel is not > destroyed* > > } > > > > * $val * 1.0; # Line Added: This causes $val to be incorrectly > interpreted as integer in future operations* > > > > is $val * 1, 0.20 or > > do { require Devel::Peek; Devel::Peek::Dump($val) }; # pv_dump says: > FLAGS = (PADMY,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) > > } > > > > __END__ > > > > *Test Case Output:* > > ok 1 > > not ok 2 > > # Failed test at test2.pl line 25. > > # got: '0' > > # expected: '0.2' > > SV = PVMG(0xf0ac0f0) at 0xe912070 > > REFCNT = 2 > > FLAGS = (GMG,SMG,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) > > IV = 0 > > NV = 0.2 > > PV = 0xf093cb0 "0.2"\0 [UTF8 "0.2"] > > CUR = 3 > > LEN = 32 > > MAGIC = 0xf093d10 > > MG_VIRTUAL = &PL_vtbl_uvar > > MG_TYPE = PERL_MAGIC_uvar(U) > > MG_LEN = 24 > > MG_PTR = 0xf0b2470 " \342C/\372*\0\0\300\vD/\372*\ > 0\0\260;\f\17\0\0\0\0" > > 1..2 > > # Looks like you failed 1 test of 2. >
Tk 804.034 was released yesterday and contains the fix. On 2017-05-08 10:49:51, romanroyer@yahoo.com wrote: Show quoted text
> I verified that commit fd52bd7 in https://github.com/eserte/perl-tk > DOES > fix the problem in my specific use case. > Thanks! > > On Thu, May 4, 2017 at 11:08 AM, Bugs in Tk via RT <bug- > Tk@rt.cpan.org> > wrote: >
> > > > Greetings, > > > > This message has been automatically generated in response to the > > creation of a trouble ticket regarding: > > "NEW Tk: perl/Tk Problem with referenced variable in Entry", > > a summary of which appears below. > > > > There is no need to reply to this message right now. Your ticket has > > been > > assigned an ID of [rt.cpan.org #121528]. Your ticket is accessible > > on the web at: > > > > https://rt.cpan.org/Ticket/Display.html?id=121528 > > > > Please include the string: > > > > [rt.cpan.org #121528] > > > > in the subject line of all future correspondence about this issue. To > > do > > so, > > you may reply to this message. > > > > Thank you, > > bug-Tk@rt.cpan.org > > > > ------------------------------------------------------------------------- > > Distribution: Tk 804.033 > > > > Perl Version: 5.24.1 > > > > OS: Linux raroyer-lnx 2.6.18-400.1.1.el5 #1 SMP Sun Dec 14 06:01:17 > > EST > > 2014 x86_64 x86_64 x86_64 GNU/Linux > > > > > > > > This new bug is very similar to this previous bug: > > https://rt.cpan.org/Public/Bug/Display.html?id=90077 > > > > which had this test added: > > https://github.com/eserte/perl- > > tk/commit/f978a133908ef715233ace871919af > > f5aeb93254?diff=unified > > > > However, by changing just two lines in the test case, it fails in the > > latest perl/Tk. > > > > > > After tying a variable containing a float to an Entry box, NOT > > destroying > > the Entry box, and then multiplying the variable by 1.0, the variable > > is no > > longer treated as a float correctly. This does NOT fail on perl <= > > 5.16, > > but fails on perl >= 5.18, which corresponds to when perl #90077 was > > fixed. > > > > > > *Failing Test Case (slight modification of #90077 Test Case):* > > > > use strict; > > > > use Test::More 'no_plan'; > > > > use Tk; > > > > > > > > my $mw = tkinit; > > > > $mw->geometry('+0+0'); > > > > > > > > { > > > > # RT #90077 > > > > my $val = 0.20; > > > > { no warnings 'void'; $val * 2 } > > > > is $val * 1, 0.20; > > > > > > > > { > > > > my $tl = $mw->Toplevel; > > > > $tl->Entry(-textvariable => \$val)->pack; > > > > * #$tl->destroy; # Line Modified: Only fails if Toplevel is > > not > > destroyed* > > > > } > > > > > > > > * $val * 1.0; # Line Added: This causes $val to be incorrectly > > interpreted as integer in future operations* > > > > > > > > is $val * 1, 0.20 or > > > > do { require Devel::Peek; Devel::Peek::Dump($val) }; # pv_dump says: > > FLAGS = (PADMY,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) > > > > } > > > > > > > > __END__ > > > > > > > > *Test Case Output:* > > > > ok 1 > > > > not ok 2 > > > > # Failed test at test2.pl line 25. > > > > # got: '0' > > > > # expected: '0.2' > > > > SV = PVMG(0xf0ac0f0) at 0xe912070 > > > > REFCNT = 2 > > > > FLAGS = (GMG,SMG,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8) > > > > IV = 0 > > > > NV = 0.2 > > > > PV = 0xf093cb0 "0.2"\0 [UTF8 "0.2"] > > > > CUR = 3 > > > > LEN = 32 > > > > MAGIC = 0xf093d10 > > > > MG_VIRTUAL = &PL_vtbl_uvar > > > > MG_TYPE = PERL_MAGIC_uvar(U) > > > > MG_LEN = 24 > > > > MG_PTR = 0xf0b2470 " \342C/\372*\0\0\300\vD/\372*\ > > 0\0\260;\f\17\0\0\0\0" > > > > 1..2 > > > > # Looks like you failed 1 test of 2. > >