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

t/general/reassign.t fails with threaded perls #10

Open
eserte opened this issue Jun 28, 2014 · 1 comment
Open

t/general/reassign.t fails with threaded perls #10

eserte opened this issue Jun 28, 2014 · 1 comment

Comments

@eserte
Copy link

eserte commented Jun 28, 2014

See subject. Analysis done with http://analysis.cpantesters.org/solved?distv=Readonly-1.60
There are passes only with threaded perl 5.20.0.

@sanko
Copy link
Owner

sanko commented Jun 28, 2014

Exposed by a test regression but the problem may be Internals::SvREADONLY($) not seeing normal constants (strings, numbers, etc) as read only on some builds of perl. Hadn't even tracked it to threaded vs non-threaded perl until now though. Thanks!

For my own future reference: historically Readonly croaks with its own error message ("Attempt to reassign a readonly scalar") if an attempt is made to do something like:

 Readonly::Scalar "hello" => "goodbye"; # These are the actual failing tests
 Readonly::Scalar1 6 => 13;

On some builds of perl, Readonly doesn't catch those and (before locking the var) goes ahead and tries to do things similar to...

  "hello" = "goodbye";
   6 = 13;

...which will obviously fail ("Can't modify constant item in scalar assignment" or "Modification of a read-only value attempted"). I've reverted the offending tests back to their less stringent versions (tagged and PAUSE'd as 1.61) but a weakened test suite is never a good thing so I won't mark this as resolved just yet.

[edited for clarity]

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

2 participants