RT #134483: Regression in Data::Dumper output between 5.18.4 and 5.28.
-
Basics
- Id
- 134483
- Status
- open
-
Dates
- Created:
- 2019-10-07 12:05:37
- Author:
- H. Merijn Brand
- Last Updated:
- 2019-10-07 16:44:42
- Closed:
-
Custom Fields
- Fixed In:
- Operating System:
- PatchStatus:
- Perl Version:
- Severity:
- low
- Type:
- unknown
-
Links
- DependedOnBy:
- DependsOn:
- MemberOf:
- Members:
- ReferredToBy:
- RefersTo:
- 74798
-
People
- Owner:
- Nobody in particular <>
- Requestors:
- yves orton <deme...@gma...>
- Cc:
- AdminCC:
# yves orton <deme...@gma...>
Mon, 07 Oct 2019 05:05:37 -0700
I have noticed that since 5.18 the output of Data::Dumper has changed at least once in an undocumented way. This is very annoying. I thought there was a way to disable the XS code, but I dont see it anymore. Regardless, optimizations have been made to DD that are clear regressions. It would be nice if no optimizations we applied unless they did not change the output. Notice that even though we selected Useqq() so there should be no single quoted constructs, in 5.28 we still get single quoted values. $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' $VAR1 = [ "4294967295", "68719476735" ]; v5.18.4 $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' $VAR1 = [ 4294967295, '68719476735' ]; v5.28.1 $ perl -v This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux Copyright 1987-2018, 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.org/, the Perl Home Page. -- perl -Mre=debug -e "/just|another|perl|hacker/"
# James E Keenan <jkee...@cpa...>
Mon, 07 Oct 2019 07:59:39 -0700
On Mon, 07 Oct 2019 12:05:37 GMT, demerphq wrote: > I have noticed that since 5.18 the output of Data::Dumper has changed > at least once in an undocumented way. This is very annoying. I > thought there was a way to disable the XS code, but I dont see it > anymore. Regardless, optimizations have been made to DD that are clear > regressions. It would be nice if no optimizations we applied unless > they did not change the output. > > Notice that even though we selected Useqq() so there should be no > single quoted constructs, in 5.28 we still get single quoted values. > > $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, > 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' > $VAR1 = [ > "4294967295", > "68719476735" > ]; > > v5.18.4 > > $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, > 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' > $VAR1 = [ > 4294967295, > '68719476735' > ]; > > v5.28.1 There was a change, but it was a conscious change. See: https://rt.perl.org/Ticket/Display.html?id=74798 Using the attached program, I was able to bisect the change using this invocation: ##### perl Porting/bisect.pl --start=v5.18.0 --end=v5.20.0 -- ./perl -Ilib ~/tmp/134483-data-dumper-output.pl ##### Output: ##### 9baac1a3613bd641a847683d7877b3cfab3244bc is the first bad commit commit 9baac1a3613bd641a847683d7877b3cfab3244bc Author: Slaven Rezic <srezic@iconmobile.com> Date: Wed Jul 10 14:18:18 2013 +1000 Data::Dumper: useqq implementation for xs Tests are mainly unchanged, just a "cheat" and a couple of TODOs were removed. ##### Thank you very much. -- James E Keenan (jkeenan@cpan.org)
# The RT System itself <>
Mon, 07 Oct 2019 07:59:39 -0700
# yves orton <deme...@gma...>
Mon, 07 Oct 2019 09:13:28 -0700
Ok, well I'll assume this is an oversight, but the implementation in that patch is clearly wrong, if useqq is selected there should not be any single quoted strings. This broke code that depends on useqq being respected. Yves On Mon, 7 Oct 2019, 16:59 James E Keenan via RT, <perlbug-followup@perl.org> wrote: > On Mon, 07 Oct 2019 12:05:37 GMT, demerphq wrote: > > I have noticed that since 5.18 the output of Data::Dumper has changed > > at least once in an undocumented way. This is very annoying. I > > thought there was a way to disable the XS code, but I dont see it > > anymore. Regardless, optimizations have been made to DD that are clear > > regressions. It would be nice if no optimizations we applied unless > > they did not change the output. > > > > Notice that even though we selected Useqq() so there should be no > > single quoted constructs, in 5.28 we still get single quoted values. > > > > $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, > > 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' > > $VAR1 = [ > > "4294967295", > > "68719476735" > > ]; > > > > v5.18.4 > > > > $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, > > 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' > > $VAR1 = [ > > 4294967295, > > '68719476735' > > ]; > > > > v5.28.1 > > There was a change, but it was a conscious change. See: > https://rt.perl.org/Ticket/Display.html?id=74798 > > Using the attached program, I was able to bisect the change using this > invocation: > > ##### > perl Porting/bisect.pl --start=v5.18.0 --end=v5.20.0 -- ./perl -Ilib > ~/tmp/134483-data-dumper-output.pl > ##### > > Output: > > ##### > 9baac1a3613bd641a847683d7877b3cfab3244bc is the first bad commit > commit 9baac1a3613bd641a847683d7877b3cfab3244bc > Author: Slaven Rezic <srezic@iconmobile.com> > Date: Wed Jul 10 14:18:18 2013 +1000 > > Data::Dumper: useqq implementation for xs > > Tests are mainly unchanged, just a "cheat" and a couple of TODOs were > removed. > ##### > > Thank you very much. > > -- > James E Keenan (jkeenan@cpan.org) >
# James E Keenan <jkee...@pob...>
Mon, 07 Oct 2019 09:23:08 -0700
On 10/7/19 12:12 PM, demerphq wrote: > Ok, well I'll assume this is an oversight, but the implementation in > that patch is clearly wrong, if useqq is selected there should not be > any single quoted strings. This broke code that depends on useqq being > respected. > > Yves > Corrected implementation welcome (though we'd have to discuss the timing of its application, as this code has been out in the wild for 6 years). > On Mon, 7 Oct 2019, 16:59 James E Keenan via RT, > <perlbug-followup@perl.org <mailto:perlbug-followup@perl.org>> wrote: > > On Mon, 07 Oct 2019 12:05:37 GMT, demerphq wrote: > > I have noticed that since 5.18 the output of Data::Dumper has changed > > at least once in an undocumented way. This is very annoying. I > > thought there was a way to disable the XS code, but I dont see it > > anymore. Regardless, optimizations have been made to DD that are > clear > > regressions. It would be nice if no optimizations we applied unless > > they did not change the output. > > > > Notice that even though we selected Useqq() so there should be no > > single quoted constructs, in 5.28 we still get single quoted values. > > > > $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, > > 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' > > $VAR1 = [ > > "4294967295", > > "68719476735" > > ]; > > > > v5.18.4 > > > > $ perl -MData::Dumper -le'print Data::Dumper->new([[ 0xFFFFFFFF, > > 0xFFFFFFFFF ]])->Useqq(1)->Dump(); print $^V' > > $VAR1 = [ > > 4294967295, > > '68719476735' > > ]; > > > > v5.28.1 > > There was a change, but it was a conscious change. See: > https://rt.perl.org/Ticket/Display.html?id=74798 > > Using the attached program, I was able to bisect the change using > this invocation: > > ##### > perl Porting/bisect.pl <http://bisect.pl> --start=v5.18.0 > --end=v5.20.0 -- ./perl -Ilib ~/tmp/134483-data-dumper-output.pl > <http://134483-data-dumper-output.pl> > ##### > > Output: > > ##### > 9baac1a3613bd641a847683d7877b3cfab3244bc is the first bad commit > commit 9baac1a3613bd641a847683d7877b3cfab3244bc > Author: Slaven Rezic <srezic@iconmobile.com > <mailto:srezic@iconmobile.com>> > Date: Wed Jul 10 14:18:18 2013 +1000 > > Data::Dumper: useqq implementation for xs > > Tests are mainly unchanged, just a "cheat" and a couple of TODOs > were removed. > ##### > > Thank you very much. > > -- > James E Keenan (jkeenan@cpan.org <mailto:jkeenan@cpan.org>) >
# H. Merijn Brand <h.m....@xs4...>
Mon, 07 Oct 2019 09:44:41 -0700
On Mon, 7 Oct 2019 12:22:43 -0400, James E Keenan <jkeenan@pobox.com> wrote: > On 10/7/19 12:12 PM, demerphq wrote: > > Ok, well I'll assume this is an oversight, but the implementation in > > that patch is clearly wrong, if useqq is selected there should not > > be any single quoted strings. This broke code that depends on useqq > > being respected. > > > > Yves > > Corrected implementation welcome (though we'd have to discuss the > timing of its application, as this code has been out in the wild for > 6 years). And it obviously needs additional tests -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.31 porting perl5 on HP-UX, AIX, and Linux https://useplaintext.email https://tux.nl http://www.test-smoke.org http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/