Closed syohex closed 9 years ago
Perl 5.21.3 also fails this test.
It's a thread safefy issue in Mouse. It has always had the potential for failure, but is more noticable in 5.21.2 onwards due to a new optimisation for looking up constant hash keys (just the HEK address is compared in the hash bucket entries, not the actual key string).
Mouse accessor XS subs have the constant key attached as magic to the CV, but also sets CvXSUBANY(xsub).any_ptr to the mg pointer as a shortcut. When a thread is cloned, the magic is cloned, but any_ptr continues pointing to the magic struct contained in the parent thread. This is bad generally (e.g. the parent thread might exit before the child thread, leaving any_ptr pointing at garbage), but specifically, the HEK embedded in the PVX field of the constant key SV points to the shared hek of the parent thread, so simple HEK pointer comparisons no longer work.
Thanks for information.
This issue is not reproduced in perl 5.21.8.
WTF. This is sometimes reproduced.
This causes test failure of
Text::Xslate
.Here is test program.
The test is failed with Perl 5.21.2
But the test is passed before Perl 5.21.2.
Is this
Perl
issue orthreads
module ?