Skip Menu |

This queue is for tickets about the Devel-CallParser CPAN distribution.

Report information
The Basics
Id: 110623
Status: open
Worked: 10 min
Priority: 0/
Queue: Devel-CallParser

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

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

Attachments


Subject: New pad corruption with threaded perls >= 5.21.5
We're seeing spectacular test failures in Kavorka and Moops with Perl 5.22.1. https://rt.cpan.org/Ticket/Display.html?id=110619 https://rt.cpan.org/Ticket/Display.html?id=109841 I've traced these down to a 5.22 regression in Devel-CallParser, as seen in the attached test case (t.pl). It looks like just using Devel::CallParser can result in a {my $var} block clobbering an existing $var. This bisects to perl commit v5.21.3-186-gc9859fb http://perl5.git.perl.org/perl.git/commit/c9859fbde1acd1489395f240f10a2a5f5eec48ea and only happens on threaded perls. The point of corruption is the av_fill(PL_comppad, padfill) call in CallParser.xs; apparently the workaround for #88341 (pad corruption on 5.18) is now harmful. The reason it was left in appears to be fixed in 5.19.5 according to http://www.nntp.perl.org/group/perl.perl5.porters/2013/09/msg208032.html so perhaps it could be disabled for newer perls? See the attached patch. I've tested that things work with this on 5.20.2 and 5.22.1. Thanks for your work, -- Niko Tyni ntyni@debian.org
Subject: 0001-Fix-a-pad-problem-with-Perl-5.21.4-on-threaded-build.patch
From ba92f4cba247c91d100e05f2b83dd093055e462b Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Fri, 25 Dec 2015 18:53:08 +0200 Subject: [PATCH] Fix a pad problem with Perl >= 5.21.4 on threaded builds This broke at least the Kavorka and Moops distributions. Bug-Debian: https://bugs.debian.org/808826 --- lib/Devel/CallParser.xs | 10 +++++++--- t/pad2.t | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 t/pad2.t diff --git a/lib/Devel/CallParser.xs b/lib/Devel/CallParser.xs index 6643739..847742c 100644 --- a/lib/Devel/CallParser.xs +++ b/lib/Devel/CallParser.xs @@ -323,10 +323,14 @@ static int my_keyword_plugin(pTHX_ * The core bug was supposedly fixed in Perl 5.19.4, but actually * that version exhibits a different bug also apparently related * to padrange. Restoring the pad's fill pointer works around - * this bug too. So for now this workaround is used with no - * upper bound on the Perl version. + * this bug too. + * + * The other padrange bug was fixed in Perl 5.19.5 (commit aa033da), + * so the workaround is no longer needed after that, but it remains + * harmless until v5.21.4 (commit c9859fb) where it starts breaking + * (see t/pad2.t.) */ -#define MUST_RESTORE_PAD_FILL PERL_VERSION_GE(5,17,6) +#define MUST_RESTORE_PAD_FILL PERL_VERSION_GE(5,17,6) && ! PERL_VERSION_GE(5,19,5) #if MUST_RESTORE_PAD_FILL I32 padfill = av_len(PL_comppad); #endif /* MUST_RESTORE_PAD_FILL */ diff --git a/t/pad2.t b/t/pad2.t new file mode 100644 index 0000000..92c6dab --- /dev/null +++ b/t/pad2.t @@ -0,0 +1,15 @@ +use warnings; +use strict; + +use Test::More tests => 1; + +use Devel::CallParser; + +sub f { + my $arg = shift; + + { my $arg; } # ??? + ok($arg, '$arg stays set after a "my $arg" block'); +} + +f(1); -- 2.6.4
Subject: t.pl
#!/usr/bin/perl -w use Devel::CallParser; sub f { my $arg = shift; { my $arg; } # ??? print $arg ? "ok\n" : "not ok\n"; } f(1);
Any reason this hasn't been fixed yet? This makes things like List::Gather unusable on new threaded Perls, which makes me sad.
This is affecting me also (Kavorka) and I'm having to install a manually patched version to work around
I'm running into this as well; it has become a show-stopper. Is a release possible?
On 2017-06-21 17:52:27, ETHER wrote: Show quoted text
> I'm running into this as well; it has become a show-stopper. > > Is a release possible?
The patch here is no good -- when it is applied, Parse::Keyword fails its tests: https://rt.cpan.org/Ticket/Display.html?id=122182
I was able to get this patch passing the included test and installing Kavorka successfully on an unthreaded Perl 5.24.1. I'm not suggesting it's right for threaded builds, but it may at least demonstrates part of a solution.
Subject: 0002-Fix-a-pad-problem-with-Perl-5.24.1-on-unthreaded-build.patch
diff --git a/lib/Devel/CallParser.xs b/lib/Devel/CallParser.xs index 6643739..847742c 100644 --- a/lib/Devel/CallParser.xs +++ b/lib/Devel/CallParser.xs @@ -323,10 +323,14 @@ static int my_keyword_plugin(pTHX_ * The core bug was supposedly fixed in Perl 5.19.4, but actually * that version exhibits a different bug also apparently related * to padrange. Restoring the pad's fill pointer works around - * this bug too. So for now this workaround is used with no - * upper bound on the Perl version. + * this bug too. + * + * The other padrange bug was fixed in Perl 5.19.5 (commit aa033da), + * so the workaround is no longer needed after that, but it remains + * harmless until v5.21.4 (commit c9859fb) where it starts breaking + * (see t/pad2.t.) */ -#define MUST_RESTORE_PAD_FILL PERL_VERSION_GE(5,17,6) +#define MUST_RESTORE_PAD_FILL USE_THREADS && PERL_VERSION_GE(5,17,6) && ! PERL_VERSION_GE(5,19,5) #if MUST_RESTORE_PAD_FILL I32 padfill = av_len(PL_comppad); #endif /* MUST_RESTORE_PAD_FILL */ diff --git a/t/pad2.t b/t/pad2.t new file mode 100644 index 0000000..92c6dab --- /dev/null +++ b/t/pad2.t @@ -0,0 +1,15 @@ +use warnings; +use strict; + +use Test::More tests => 1; + +use Devel::CallParser; + +sub f { + my $arg = shift; + + { my $arg; } # ??? + ok($arg, '$arg stays set after a "my $arg" block'); +} + +f(1); -- 2.6.4
On Thu Jun 22 18:32:11 2017, ETHER wrote: Show quoted text
> On 2017-06-21 17:52:27, ETHER wrote:
> > I'm running into this as well; it has become a show-stopper. > > > > Is a release possible?
> > The patch here is no good -- when it is applied, Parse::Keyword fails > its tests: https://rt.cpan.org/Ticket/Display.html?id=122182
As I mentioned in that ticket, it works for me. The reason why this fails: sub f { my $arg = shift; { my $arg; } # ??? print $arg ? "ok\n" : "not ok\n"; } f(1); with an unpatched Devel::CallParser under thread-capable builds is that AvFILL gets restored on PL_comppad, but not on PL_comppad_name. If both were to be restored at the same time, the workaround would work in any version (untested). But the workaround is not necessary for 5.20+, so the proposed patch should work just fine (and does for me).

Message body is not shown because it is too large.

Subject: build.log
Download build.log
application/octet-stream 21.4k

Message body not shown because it is not plain text.

On Tue Jun 27 14:59:07 2017, ETHER wrote: Show quoted text
> With the patch in https://rt.cpan.org/Ticket/Display.html?id=110623, > Parse::Keyword's tests fail; without the patch (using DCP 0.002), its > tests > pass. However, Kavorka still has issues, which the author believes is > still > due to Devel::CallParser: > https://rt.cpan.org/Ticket/Display.html?id=109841 > > I experience the same failures as described in the ticket (attached).
Your build log shows me the Kavorka failures (which I can reproduce), but not the Parse::Keyword failures. Could you attach a build log that shows how Parse::Keyword is failing?
On 2017-06-27 13:41:19, SPROUT wrote: Show quoted text
> Your build log shows me the Kavorka failures (which I can reproduce), > but not the Parse::Keyword failures. Could you attach a build log > that shows how Parse::Keyword is failing?
It seems to have turned into a heisenbug that I cannot reproduce :( This is good news though -- presently it looks like everything is fine, and we just need Devel::CallParser to release this patch and Parse::Keyword and Kavorka will be working again. Zefram, could you do that please? Even a -TRIAL release for now would be sufficient to let downstream users confirm that the patch is sufficient. thank you very much in advance!
Is Zefram still exist? No releases for over a year; only three releases in the last two years. I know: pot, kettle, black.
From: greeneg [...] tolharadys.net
On Sun Jul 09 10:18:21 2017, TOBYINK wrote: Show quoted text
> Is Zefram still exist? > > No releases for over a year; only three releases in the last two years. > > I know: pot, kettle, black
Agreed. Patch works with threaded Perl (5.24.1) on Mac and allows Kavorka to be unblocked. Please someone get this released. If Zefram has disappeared can we get someone else to make a release for it?
+1 On Sun Aug 13 00:02:30 2017, greeneg@tolharadys.net wrote: Show quoted text
> On Sun Jul 09 10:18:21 2017, TOBYINK wrote:
> > Is Zefram still exist? > > > > No releases for over a year; only three releases in the last two > > years. > > > > I know: pot, kettle, black
> > Agreed. Patch works with threaded Perl (5.24.1) on Mac and allows > Kavorka to be unblocked. Please someone get this released. If Zefram > has disappeared can we get someone else to make a release for it?
RT-Send-CC: ZEFRAM [...] cpan.org
Maybe Zefram has not been informed yet? Recently he as posted on P5P, so I retry with a One-time Cc to ZEFRAM@cpan.org Zefram, please chime in. I think everything has been said in the ticket already.
RT-Send-CC: ZEFRAM [...] cpan.org
Patching this module by hand is still required - 2018-feb-22
Surely this has been sitting around for long enough now? Anyone know the steps we need to take to get someone else access on CPAN to make a release for this module? I think its called co-maint but I've never had to do this myself before so I'm a little out of my depth with the procedure?
Until this is fixed properly, I've uploaded a patched version to CPAN: https://metacpan.org/release/TOBYINK/Alt-Devel-CallParser-ButWorking-0.002 This should make it slightly easier to get a working copy of Devel::CallParser installed. cpanm Alt::Devel::CallParser::ButWorking