http://www.perlmonks.org?node_id=994710


in reply to "double free or corruption" in Perl 5.16.0 but not in 5.14.2

I reproduced this with bleadperl. This patch fixes the problem and all core tests pass, but it doesn't quite pass my eyeball test. It's worth filing a bug with p5p.

diff --git a/ext/File-Glob/Glob.xs b/ext/File-Glob/Glob.xs index 3ea0590..f8bc20f 100644 --- a/ext/File-Glob/Glob.xs +++ b/ext/File-Glob/Glob.xs @@ -237,8 +237,8 @@ csh_glob(pTHX_ AV *entries, SV *patsv) SV **svp = AvARRAY(patav); while (items--) { PUSHMARK(SP); - PUTBACK; doglob(aTHX_ SvPVXx(*svp++), flags); + PUTBACK; SPAGAIN; { dMARK;

Replies are listed 'Best First'.
Re^2: "double free or corruption" in Perl 5.16.0 but not in 5.14.2
by mje (Curate) on Sep 20, 2012 at 18:05 UTC

    Thanks. I just reported it with perlbug half an hour ago at https://rt.perl.org/rt3/Ticket/Display.html?id=114984. I'll try your patch.

      Unfortunately, patch applied against 5.17.4 gave the following test errors.

      ../cpan/CGI/t/tmpdir.t (Wstat +: 0 Tests: 9 Failed: 0) TODO passed: 3-9 ../ext/File-Glob/t/basic.t (Wstat +: 768 Test s: 49 Failed: 3) Failed tests: 19, 21-22 Non-zero exit status: 3 Files=2336, Tests=548419, 725 wallclock secs (50.53 usr 6.81 sys + 40 +1.23 cusr 34.93 csys = 493.50 CPU) Result: FAIL

      Perhaps I applied it incorrectly - will check.

        It's a bad patch. I'm not sure why I thought it passed with bleadperl (and I knew it didn't look right), but for whatever reason, it's a bad patch.

        I'm pretty sure the patch was applied correctly to 5.17.4. I went back to stock 5.17.4 and all tests pass. With the patch the tests above fail.