Skip to content
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

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

Open
rschupp opened this issue Jan 13, 2021 · 0 comments

Comments

@rschupp
Copy link
Owner

rschupp commented Jan 13, 2021

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

Requestors:

From [email protected] 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.





Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant