-
Notifications
You must be signed in to change notification settings - Fork 584
Storable can't locate module because package is in a different file #19259
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
Comments
Can you explain why you believe this should be classified as a bug in Storable (which is maintained here in core) rather than a bug in Readonly (which is maintained upstream on CPAN)? |
I would have thought that since the Readonly.pm file contains the (e.g.) Readonly::Hash package, that it would already be in the namespace and thus thawing an object containing a Readonly hash would not cause an error. That said, it appears that perhaps that's not the case. Also, as I dug deeper, it appears that Readonly 2.02 added a STORABLE_freeze function to Readonly::Scalar, Readonly::Array and Readonly::Hash, and that those functions are what's causing this issue. Here's the Array function, but they're essentially the same just for different data types:
Commenting those functions out of the Readonly module resolves the issue, so it may well be that it really is a Readonly problem. That said, it was reported to the maintainer 5 years ago and his response was that the reporter could fork, fix and submit a PR, but that's all they were doing. So if you have any suggestions on how to fix Readonly instead, I'll be happy to try to work with them and go that route. |
I agree that this module's bug queue is getting long. Can you identify the specific bug ticket you're mentioning? |
Readonly Issue #27. That said, I found a reference to ReadonlyX which appears to be the same author rewriting Readonly as a near drop-in replacement without the legacy issues, and it works with Storable. So I'm inclined to just switch to using that and see if it has problems, and if not I'll call it a day. In any event, I now agree that this is most likely not a Storable issue, but a Readonly issue, so I'm fine if you want to close this issue out. |
Thank you for taking the time to dig deeper into this. Closing ticket per your recommendation. |
Module: Storable
Description
Thawing a frozen object containing a Readonly Array or Hash causes perl to crash with the following error:
(The same error happens except with Readonly/Array.pm and Readonly::Array - it's random which happens because the program in question uses both)
This is because the Readonly::Hash and Readonly::Array packages are located inside Readonly.pm. Note that this did not happen on RHEL 7 using the Perl 5.26 SCL and the exact same code - the only relevant differences are that Readonly is v2.00 on EL7 and 2.05 on EL8.
Steps to Reproduce
Expected behavior
The frozen data structure should be thawed without crashing.
Perl configuration
The text was updated successfully, but these errors were encountered: