Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in Data::Dumper output between 5.18.4 and 5.28. #17176

Open
p5pRT opened this issue Oct 7, 2019 · 8 comments
Open

Regression in Data::Dumper output between 5.18.4 and 5.28. #17176

p5pRT opened this issue Oct 7, 2019 · 8 comments
Labels
dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution

Comments

@p5pRT
Copy link

p5pRT commented Oct 7, 2019

Migrated from rt.perl.org#134483 (status was 'open')

Searchable as RT134483$

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2019

From @demerphq

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/"

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2019

From @jkeenan

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-archive.perl.org/perl5/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​:

#####
9baac1a is the first bad commit
commit 9baac1a
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)

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2019

From @jkeenan

134483-data-dumper.pl

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2019

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2019

From @demerphq

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-archive.perl.org/perl5/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​:

#####
9baac1a is the first bad commit
commit 9baac1a
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)

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2019

From @jkeenan

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&#8203;:05&#8203;:37 GMT\, demerphq wrote&#8203;:
 > I have noticed that since 5\.18 the output of Data&#8203;::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&#8203;::Dumper \-le'print Data&#8203;::Dumper\->new\(\[\[ 0xFFFFFFFF\,
 > 0xFFFFFFFFF \]\]\)\->Useqq\(1\)\->Dump\(\); print $^V'
 > $VAR1 = \[
 >           "4294967295"\,
 >           "68719476735"
 >         \];
 >
 > v5\.18\.4
 >
 > $ perl \-MData&#8203;::Dumper \-le'print Data&#8203;::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&#8203;:
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=74798

Using the attached program\, I was able to bisect the change using
this invocation&#8203;:

\#\#\#\#\#
perl Porting/bisect\.pl \<http&#8203;://bisect\.pl> \-\-start=v5\.18\.0
\-\-end=v5\.20\.0 \-\- \./perl \-Ilib ~/tmp/134483\-data\-dumper\-output\.pl
\<http&#8203;://134483\-data\-dumper\-output\.pl>
\#\#\#\#\#

Output&#8203;:

\#\#\#\#\#
9baac1a3613bd641a847683d7877b3cfab3244bc is the first bad commit
commit 9baac1a3613bd641a847683d7877b3cfab3244bc
Author&#8203;: Slaven Rezic \<srezic@&#8203;iconmobile\.com
\<mailto&#8203;:srezic@&#8203;iconmobile\.com>>
Date&#8203;:   Wed Jul 10 14&#8203;:18&#8203;:18 2013 \+1000

Data&#8203;::Dumper&#8203;: 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@&#8203;cpan\.org \<mailto&#8203;:jkeenan@&#8203;cpan\.org>\)

@p5pRT
Copy link
Author

p5pRT commented Oct 7, 2019

From @Tux

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/

@jkeenan jkeenan added the dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution label Jul 5, 2021
@xenu xenu removed the Severity Low label Dec 29, 2021
@khwilliamson
Copy link
Contributor

@demerphq, what to do about this ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution
Projects
None yet
Development

No branches or pull requests

4 participants