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

use base before namespace::clean #114

Closed
wants to merge 1 commit into from

Conversation

haarg
Copy link
Contributor

@haarg haarg commented Oct 16, 2017

namespace::clean uses the hints hash to track when it should do its
work. Without extra protection, using hints across nested module
loads can crash on perl <= 5.8.3. Older versions of base.pm used a
string eval, which served to provide the isolation needed to avoid the
bug.

Moving the use base before the use namespace::clean means the hints
aren't used until after the other modules are loaded, which avoids this
issue.

An alternate workaround would involve localizing the hints, but this
involves intercepting the module loads. This would mean using something
like Module::Runtime or Lexical::SealRequireHints, although those modules
don't currently provide the localization needed to workaround this
specific issue.

namespace::clean uses the hints hash to track when it should do its
work.  Without extra protection, using hints across nested module
loads can crash on perl <= 5.8.3.  Older versions of base.pm used a
string eval, which served to provide the isolation needed to avoid the
bug.

Moving the use base before the use namespace::clean means the hints
aren't used until after the other modules are loaded, which avoids this
issue.

An alternate workaround would involve localizing the hints, but this
involves intercepting the module loads.  This would mean using something
like Module::Runtime or Lexical::SealRequireHints, although those modules
don't currently provide the localization needed to workaround this
specific issue.
@ribasushi
Copy link
Collaborator

@haarg I believe I fixed this for good via https://metacpan.org/diff/file?source=ETHER/B-Hooks-EndOfScope-0.21&target=ETHER/B-Hooks-EndOfScope-0.24#lib/B/Hooks/EndOfScope/PP/HintHash.pm

Double check if I am correct before I close this PR as "no longer needed"

@haarg haarg closed this May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants