Skip to content

[cperl] panic: attempt to copy freed scalar ... to ... at <embedded>/Tie/Hash/NamedCapture.pm [rt.cpan.org #133081] #34

@rschupp

Description

@rschupp

Migrated from rt.cpan.org#133081 (status was 'new')

Requestors:

From rschupp@cpan.org on 2020-07-30 12:35:46
:

When building PAR::Packer with cperl (at least 5.28.2c, 5.30.0c) almost all test fail
with the same error message:

$ pp -o a.exe -E 0
panic: attempt to copy freed scalar 55c95f55e3e0 to 55c95f55dde0 at <embedded>/Tie/Hash/NamedCapture.pm line 7.
Compilation failed in require at -e line 140.

This is caused by cperl moving XSLoader from an external XSLoader.pm module directly into DynaLoader.so, hence patching XSLoader.pm via PAR::Filter::PatchContent doesn't work anymore.

As reminder to myself: looks like the following is happening:

1. pp runs (in PAR::Packer::_generate_output)
   parl -B -Oa.exe some.par

2. loads Tie/Hash/NamedCapture.pm with demangled name from the cache area

3. loads NamedCapture.so from the install location (_not_ the demangled copy from 
   the cache area though it is present) and calls boot_Tie__Hash__NamedCapture
   which panics

At that point (2) and (3) have worked successfully for lots of other "embedded" modules, 
so I dunno why Tie::Hash::NamedCapture behaves differently.
But the real problem is that dynamic loading of mangled DLLs from the cache area 
doesn't work, because intercepting dynamic loading doesn't work without the
patch to XSLoader.





Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions