Bug#718438: Shared references (threads::shared) disappear on sub return in perl

Dominic Hargreaves dom at earth.li
Thu Aug 29 14:22:15 UTC 2013


On Mon, Aug 05, 2013 at 11:39:56AM +0300, Niko Tyni wrote:

> unstable will be moving to 5.18 soonish, so this mainly concerns wheezy.
> Assuming a clean enough patch, I expect we can push it into a stable
> update.
> 
> Unfortunately 6f48390ab209d16ee8f795f0a83677c8bd9ac69c isn't easily
> backportable, there are conflicts due to earlier changes in the 5.15
> series. I haven't had the time to work through them yet.
> 
> If you (or anybody else, of course) want to help, a clean backported
> patch for 5.14 would be appreciated.

I happened upon an update on the upstream bug from Nicholas Clark which
includes a potential (different) fix for 5.14:

https://rt.perl.org/rt3/Ticket/Attachment/1241489/647243/

"I believe that the fix is to change threads::shared to deal with cleanup
differently, so that the last magic struct which frees up the relevant
mg_obj is responsible for cleaning up shared space. This means adding "free"
magic to the element proxies:

[...] patch supplied, which the same, or similar to

http://perl5.git.perl.org/perl.git/commit/9b9aaeae0f62

In summary it looks like there might be a patch we can apply directly
to 5.14, but

a) I have not verified it applies and fixes the stated bug
b) I am not yet sure it is suitable to apply. Maybe we could ask
   Nicholas for an opinion.

Dominic.




More information about the Perl-maintainers mailing list