develooper Front page | perl.perl5.porters | Postings from April 2019

[perl #133977] Blead breaks CPAN: 657ed7c1 breaks XML::Parser

Thread Previous
From:
James E Keenan
Date:
April 3, 2019 00:43
Subject:
[perl #133977] Blead breaks CPAN: 657ed7c1 breaks XML::Parser
Message ID:
rt-4.0.24-32142-1554252205-499.133977-75-0@perl.org
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #133977]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133977 >


In the course of investigating the status of RT 132577 re 
Module::Install, I happened to notice that blead was breaking 
XML::Parser version 2.44.  Recent breakage has also been reported via 
Carlos Guevara's smoke-testing rigs 
(http://matrix.cpantesters.org/?dist=XML-Parser%202.44;os=linux;perl=5.29.10;reports=1).

With the following bisection command ...

#####
perl Porting/bisect.pl -Duseithreads \
--start=6256cf2c2cee30277e34d38416070f9ec671c989 \
--module=XML::Parser
#####

... I was able to identify this point of breakage

#####
657ed7c1c190e7fad1bac2979944d07245bbeea4 is the first bad commit
commit 657ed7c1c190e7fad1bac2979944d07245bbeea4
Author: David Mitchell <davem@iabyn.com>
Date:   Tue Mar 26 08:56:55 2019 +0000

fix leak in package name lookup

S_parse_gv_stash_name() mallocs a temporary buffer when
scanning package names longer than 64 bytes. Depending on
how it exits the function, it doesn't always free the
buffer afterwards. Change the function so that there are
only two exit points (which free the buffer) and make other
bits of code goto those two points.

Can be reproduced with e.g.

&{"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxx'x"}

Similar code is already present in t/op/stash_parse_gv.t
#####

Here is the failing test:

#####
[XML-Parser-2.44] 524 $ bleadprove -vb t/decl.t
t/decl.t ..
1..40
ok 1
double free or corruption (!prev)
Failed 39/40 subtests

Test Summary Report
-------------------
t/decl.t (Wstat: 134 Tests: 1 Failed: 0)
   Non-zero wait status: 134
   Parse errors: Bad plan.  You planned 40 tests but ran 1.
Files=1, Tests=1,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.05 cusr 
0.01 csys =  0.08 CPU)
Result: FAIL
#####

I should note that for almost three years there has been a development 
release of XML::Parser, 2.44_01, which has been getting CPANtesters 
reports but which has not been officially released to CPAN.  My testing 
indicates that this version also is broken on Perl 5 blead 
(v5.29.9-50-gfcacab092a).

Thank you very much.
Jim Keenan

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About