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
Segfault in 5.18.2 with Digest::SHA #13656
Comments
From mshelor@cpan.orgThis is a bug report for perl from mshelor@cpan.org, Invoking Digest::SHA methods in nonsensical or incorrect orders The problem arises from the SHA module's failure to perform This bug report includes a patch which corrects the problem in $ $p18 -le "use Digest::SHA; print Digest::SHA->add(qq(a))->hexdigest" Subsequent to applying the patch, the following correct behavior $ $p18p -le "use Digest::SHA; print Digest::SHA->add(qq(a))->hexdigest" The patch is applied by running $ patch -p0 <SHA.xs.patch from the directory in which the tarball is unrolled. Or see header in Mark Flags: Site configuration information for perl 5.10.1: Configured by Debian Project at Tue Apr 26 15:56:23 UTC 2011. Summary of my perl5 (revision 5 version 10 subversion 1) configuration: Platform: Locally applied patches: @INC for perl 5.10.1: Environment for perl 5.10.1: PATH=/home/mshelor/bin:/home/mshelor/coreutils/bin:/home/mshelor/perllib/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:. |
From mshelor@cpan.orgSHA.xs.patch--- perl-5.18.2/cpan/Digest-SHA/SHA.xs 2014-01-06 15:46:43.000000000 -0700
+++ perl-5.18.2.patched/cpan/Digest-SHA/SHA.xs 2014-03-11 13:10:38.594772734 -0700
@@ -34,6 +34,8 @@
CODE:
RETVAL = shaclose(s);
sv_setiv(SvRV(ST(0)), 0);
+OUTPUT:
+ RETVAL
int
shadump(file, s)
@@ -186,6 +188,8 @@
SHA *state;
int result;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
result = ix ? shaalg(state) : shadsize(state) << 3;
ST(0) = sv_2mortal(newSViv(result));
@@ -200,6 +204,8 @@
STRLEN len;
SHA *state;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
for (i = 1; i < items; i++) {
data = (unsigned char *) (SvPVbyte(ST(i), len));
@@ -224,6 +230,8 @@
SHA *state;
char *result;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
shafinish(state);
len = 0;
|
From @jkeenanOn Tue Mar 11 14:35:50 2014, mshelor@cpan.org wrote:
[snip] Mark, I'm somewhat confused as to how to handle this. Digest::SHA is included in the Perl 5 core distribution, but its positioning under the 'cpan/' directory suggests that it is primarily maintained on CPAN. In this case, we normally move the complaint to the CPAN distro's bug tracker, request that the maintainer correct the problem in CPAN and release a new CPAN version and notify p5p when the new CPAN release is available. In the meantime, we usually mark the ticket in RT as "Rejected" and "SendtoCPAN". However, when I check Porting/Maintainers.pl, I see: ##### ... which suggests that I would just be referring the issue back to you! Can you advise? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiOn Wed, Mar 12, 2014 at 7:09 PM, James E Keenan via RT <
It's already fixed on CPAN ("a problem that was corrected in Digest::SHA |
From @ikegamiOn Wed, Mar 12, 2014 at 8:05 PM, Eric Brine <ikegami@adaelis.com> wrote:
1. Bleed already has 5.87, and 5.87 has the checks the patch in the ticket 2. 5.18.2 has 5.84_01, which doesn't have the fix. The ticket was filed 3. Note that neither CPAN nor bleed has the following change described by @@ -34,6 +34,8 @@ int |
From @ppisarOn 2014-03-13, Eric Brine <ikegami@adaelis.com> wrote:
No upgrade. Just applying the fix. 5.87 contains more changes than this -- Petr |
From mshelor@cpan.orgOn 03/12/2014 05:18 PM, Eric Brine via RT wrote:
That sums it up. Regarding item 2: the latest stable release is 5.18.2, so one assumes Re item 3, the missing OUTPUT clause for Digest::SHA 5.87 now causes a So, for item 1, blead should apply the patch if it wants to silence the Mark |
From mshelor@cpan.orgOn 03/12/2014 05:18 PM, Eric Brine via RT wrote:
That sums it up. Regarding Item 2: the latest stable release is 5.18.2, so one assumes Re Item 3, the missing OUTPUT clause for Digest::SHA 5.87 now causes a So, for Item 1, blead should apply the initial fragment of the patch Mark |
From @ikegamiOn Thu, Mar 13, 2014 at 1:47 AM, Mark Shelor <m.shelor@cox.net> wrote:
Changes can be applied to 5.18 (which is to say the "maint-5.18" branch), Perl 5.18.2 has Digest::SHA 5.84_01. If a Perl release has something other
It would make far more sense to wait for Digest::SHA 5.88 to come out and (Note: I don't know the schedule for 5.18.3 and 5.20.0. Deadlines could (Note: I have no idea what's the policy on upgrading modules in maint |
From mshelor@cpan.orgOn 03/13/2014 09:35 PM, Eric Brine wrote:
Digest::SHA 5.88 is now published and available for download. |
From @rjbs* Eric Brine <ikegami@adaelis.com> [2014-03-14T00:35:37]
The policy is that we only apply fixes for crashers or security problems, more We have not established a release date for 5.12.3. -- |
From @tonycozOn Thu Mar 13 02:10:21 2014, ppisar wrote:
I've attached the fix as a format-patch patch. +1 from me Tony |
From @tonycoz0001-perl-121421-backport-Digest-SHA-fix.patchFrom e54b4fa82c46457a9bb0e40bb9479b0ce8e88f21 Mon Sep 17 00:00:00 2001
From: Mark Shelor <m.shelor@cox.net>
Date: Wed, 16 Apr 2014 16:05:45 +1000
Subject: [perl #121421] backport Digest::SHA fix
---
AUTHORS | 1 +
cpan/Digest-SHA/SHA.xs | 8 ++++++++
cpan/Digest-SHA/lib/Digest/SHA.pm | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/AUTHORS b/AUTHORS
index 9cf6807..c5239af 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -733,6 +733,7 @@ Mark P. Lutz <mark.p.lutz@boeing.com>
Mark Pease <peasem@primenet.com>
Mark Pizzolato <mark@infocomm.com>
Mark R. Levinson <mrl@isc.upenn.edu>
+Mark Shelor <m.shelor@cox.net>
Mark Stosberg <mark@summersault.com>
Marko Asplund <aspa@merlot.kronodoc.fi>
Marnix van Ammers <marnix@gmail.com>
diff --git a/cpan/Digest-SHA/SHA.xs b/cpan/Digest-SHA/SHA.xs
index 47bef28..cb54fc4 100644
--- a/cpan/Digest-SHA/SHA.xs
+++ b/cpan/Digest-SHA/SHA.xs
@@ -34,6 +34,8 @@ shaclose(s)
CODE:
RETVAL = shaclose(s);
sv_setiv(SvRV(ST(0)), 0);
+OUTPUT:
+ RETVAL
int
shadump(file, s)
@@ -186,6 +188,8 @@ PREINIT:
SHA *state;
int result;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
result = ix ? shaalg(state) : shadsize(state) << 3;
ST(0) = sv_2mortal(newSViv(result));
@@ -200,6 +204,8 @@ PREINIT:
STRLEN len;
SHA *state;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
for (i = 1; i < items; i++) {
data = (unsigned char *) (SvPVbyte(ST(i), len));
@@ -224,6 +230,8 @@ PREINIT:
SHA *state;
char *result;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
shafinish(state);
len = 0;
diff --git a/cpan/Digest-SHA/lib/Digest/SHA.pm b/cpan/Digest-SHA/lib/Digest/SHA.pm
index 9a631b1..4f84f97 100644
--- a/cpan/Digest-SHA/lib/Digest/SHA.pm
+++ b/cpan/Digest-SHA/lib/Digest/SHA.pm
@@ -7,7 +7,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use Fcntl;
use integer;
-$VERSION = '5.84_01';
+$VERSION = '5.84_02';
require Exporter;
require DynaLoader;
--
1.7.10.4
|
From @tonycozOn Wed, Apr 16, 2014 at 07:52:11PM -0700, Mark Shelor wrote:
It's not, since it hasn't been applied. I've attached a new format-patched commit with the changed email CC: p5p so it's picked up for the ticket. Tony |
From @tonycoz0001-perl-121421-backport-Digest-SHA-fix.patchFrom a7d7f71f804acaaefc80c8f10a201feb40c1e40e Mon Sep 17 00:00:00 2001
From: Mark Shelor <mshelor@cpan.org>
Date: Wed, 16 Apr 2014 16:05:45 +1000
Subject: [PATCH] [perl #121421] backport Digest::SHA fix
---
AUTHORS | 1 +
cpan/Digest-SHA/SHA.xs | 8 ++++++++
cpan/Digest-SHA/lib/Digest/SHA.pm | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/AUTHORS b/AUTHORS
index 9cf6807..e39e1e1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -733,6 +733,7 @@ Mark P. Lutz <mark.p.lutz@boeing.com>
Mark Pease <peasem@primenet.com>
Mark Pizzolato <mark@infocomm.com>
Mark R. Levinson <mrl@isc.upenn.edu>
+Mark Shelor <mshelor@cpan.org>
Mark Stosberg <mark@summersault.com>
Marko Asplund <aspa@merlot.kronodoc.fi>
Marnix van Ammers <marnix@gmail.com>
diff --git a/cpan/Digest-SHA/SHA.xs b/cpan/Digest-SHA/SHA.xs
index 47bef28..cb54fc4 100644
--- a/cpan/Digest-SHA/SHA.xs
+++ b/cpan/Digest-SHA/SHA.xs
@@ -34,6 +34,8 @@ shaclose(s)
CODE:
RETVAL = shaclose(s);
sv_setiv(SvRV(ST(0)), 0);
+OUTPUT:
+ RETVAL
int
shadump(file, s)
@@ -186,6 +188,8 @@ PREINIT:
SHA *state;
int result;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
result = ix ? shaalg(state) : shadsize(state) << 3;
ST(0) = sv_2mortal(newSViv(result));
@@ -200,6 +204,8 @@ PREINIT:
STRLEN len;
SHA *state;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
for (i = 1; i < items; i++) {
data = (unsigned char *) (SvPVbyte(ST(i), len));
@@ -224,6 +230,8 @@ PREINIT:
SHA *state;
char *result;
PPCODE:
+ if (!sv_isa(self, "Digest::SHA"))
+ XSRETURN_UNDEF;
state = INT2PTR(SHA *, SvIV(SvRV(SvRV(self))));
shafinish(state);
len = 0;
diff --git a/cpan/Digest-SHA/lib/Digest/SHA.pm b/cpan/Digest-SHA/lib/Digest/SHA.pm
index 9a631b1..4f84f97 100644
--- a/cpan/Digest-SHA/lib/Digest/SHA.pm
+++ b/cpan/Digest-SHA/lib/Digest/SHA.pm
@@ -7,7 +7,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use Fcntl;
use integer;
-$VERSION = '5.84_01';
+$VERSION = '5.84_02';
require Exporter;
require DynaLoader;
--
1.7.10.4
|
From @jkeenanOn Tue Apr 15 23:17:37 2014, tonyc wrote:
Could we get a test that demonstrates that we have fixed the problem? Thank you very much. |
From @maukeOn Wed Apr 16 20:37:20 2014, tonyc wrote:
I believe this ticket can be closed (it's listed in perl5184delta). Any objections? |
From @jkeenanOn Fri Feb 26 09:25:23 2016, mauke- wrote:
I'm puzzled by the status of this ticket. TonyC submitted a patch (the later of the two attachments), but I don't find any evidence that it was applied in blead. On the other hand, the version of cpan/Digest-SHA/lib/Digest/SHA.pm in blead is 5.95 -- considerably beyond the 5.84_02 in Tony's patch. The entry in perl5184delta is rather opaque. And no one ever responded to my request that a test be written demonstrating that the problem had been fixed. Hence: confusion. Thank you very much. -- |
From mshelor@cpan.orgOn 02/26/2016 04:10 PM, James E Keenan via RT wrote:
A workaround was submitted with Digest::SHA 5.85 in late June 2013. See ... https://rt.cpan.org/Public/Bug/Display.html?id=86295 for background and details. James, you'll see why providing a test to Mark |
From @maukeAm Fr 26. Feb 2016, 21:24:39, mshelor@cpan.org schrieb:
That link says: | I use the more cautious word 'appears' since the bug is difficult to reproduce reliably. But your original message in this ticket says: | Before the patch is applied, this is what occurs: Is this even the same issue? |
From mshelor@cpan.orgOn 02/27/2016 02:20 AM, l.mai@web.de via RT wrote:
You're correct: it isn't the same issue. perl #121421 is much much The #121421 issue was already resolved with the release of Digest::SHA I too am confused why this ticket remains open. |
From @jkeenanOn Fri Feb 26 21:24:39 2016, mshelor@cpan.org wrote:
Alright, then I have no objection to closing this ticket. Thank you very much. -- |
From @maukeOn Sat Feb 27 03:24:04 2016, mshelor@cpan.org wrote:
This ticket is specifically about the 5.18.* series (and potentially blocking a 5.18.5 release), so blead/5.87 doesn't matter. I can confirm that the patch in this ticket was applied in commit 0e7dab7 (but without the "[perl #121421]" part of the subject, which makes it slightly harder to find), which was released in Digest::SHA 5.84_02 / perl 5.18.4. corelist claims 5.18.4 still had Digest::SHA 5.84_01, but I think that's a bug in Module::CoreList: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=127624 Closing. |
@mauke - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#121421 (status was 'resolved')
Searchable as RT121421$
The text was updated successfully, but these errors were encountered: