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

'dzil build' fails in Run::BeforeArchive plugin #1

Open
mrscotty opened this issue Apr 18, 2017 · 0 comments
Open

'dzil build' fails in Run::BeforeArchive plugin #1

mrscotty opened this issue Apr 18, 2017 · 0 comments

Comments

@mrscotty
Copy link
Member

When running 'dzil build', it fails with the output:

[Run::BeforeArchive] executing: sed -i -e'/^=head1 AUTHOR/i=for readme start\n\n' Crypt-PKCS10-1.4/lib/Crypt/PKCS10.pm [Run::BeforeArchive] sed: 1: "Crypt-PKCS10-1.4/lib/Cr ...": invalid command code C

This appears to have been introduced between V1.4_04 and V1.4.

wchristian added a commit to wchristian/Crypt-PKCS10 that referenced this issue Aug 4, 2023
this was two different leaks rolled into one, which i will explain below.
i also have to note the test still leaks *some* objects, but i don't have
the time to do full analysis on that

modules used to diagnose the leaks:
Net::Prometheus, Devel::Gladiator, Devel::FindRef, Devel::Cycle

openxpki#1 is the globals in the parser holding on to things

normally deciding when to clean these up could be a little tricky, but the
parsing appears to be contained entirely within the _new method, so we can
declare them local and have perl reset them at the end of scope

optimally Convert::ASN1 would take care of this so they're deleted after
they're needed; as well as instanced per object or creation of new parsers
guarded while one is currently active

openxpki#2 is PKCS10 creating the object, running ->find on it, which returns a
*shallow* copy with a reference to a config hash in the original object,
then puts said shallow copy into the config hash of the original object,
which creates a cycle

i don't know whether a deep clone is appropriate there, so i just had the
wrapping module weaken the reference to the config hash
wchristian added a commit to wchristian/Crypt-PKCS10 that referenced this issue Aug 8, 2023
this was two different leaks rolled into one, which i will explain below.
i also have to note the test still leaks *some* objects, but i don't have
the time to do full analysis on that

modules used to diagnose the leaks:
Net::Prometheus, Devel::Gladiator, Devel::FindRef, Devel::Cycle

openxpki#1 is the globals in the parser holding on to things

normally deciding when to clean these up could be a little tricky, but the
parsing appears to be contained entirely within the _new method, so we can
declare them local and have perl reset them at the end of scope

optimally Convert::ASN1 would take care of this so they're deleted after
they're needed; as well as instanced per object or creation of new parsers
guarded while one is currently active

openxpki#2 is PKCS10 creating the object, running ->find on it, which returns a
*shallow* copy with a reference to a config hash in the original object,
then puts said shallow copy into the config hash of the original object,
which creates a cycle

at first i thought weaken would be the more appropriate option here, but
that simply crashed on trying to parse certain certs, so a deep clone is
used and seems to fix the issue
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