Bug#718438: [perl #119089] Shared references (threads::shared) disappear on sub return

Dominic Hargreaves dom at earth.li
Sat Sep 14 23:08:05 UTC 2013


On Fri, Sep 13, 2013 at 02:26:57PM +0100, Nicholas Clark wrote:
> On Sat, Sep 07, 2013 at 07:25:39PM +0100, Dominic Hargreaves wrote:
> > On Sat, Sep 07, 2013 at 10:22:20AM -0700, Dominic Hargreaves via RT wrote:
> 
> > > I understand that there won't be another 5.14 release for this, but in 
> > > Debian this is still potentially an issue for us (see 
> > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718438). Is there any 
> > > reason we shouldn't look at applying Nicholas's patch in Debian?
> > 
> > FWIW, I tried applying it to the Debian 5.14 and got:
> > 
> > dist/threads-shared/t/av_refs..................................../../t/perl: symbol lookup error: ../../lib/auto/threads/shared/shared.so: undefined symbol: SHAREDSV_FROM_OBJ
> > FAILED--expected 16 tests, saw 15
> > 
> > dist/threads-shared/t/clone....................................../../t/perl: symbol lookup error: ../../lib/auto/threads/shared/shared.so: undefined symbol: SHAREDSV_FROM_OBJ
> > FAILED--expected 34 tests, saw 20
> > 
> > dist/threads-shared/t/hv_refs..................................../../t/perl: symbol lookup error: ../../lib/auto/threads/shared/shared.so: undefined symbol: SHAREDSV_FROM_OBJ
> > FAILED--expected 22 tests, saw 12
> > 
> > dist/threads-shared/t/shared_attr................................/../t/perl: symbol lookup error: ../../lib/auto/threads/shared/shared.so: undefined symbol: SHAREDSV_FROM_OBJ
> > FAILED--non-zero wait status: 32512
> 
> You applied the patch to Debian? Or you built the current threads-shared
> for Debian?

The former.

> Because that macro was added to threads::shared in version 1.42, which in
> blead was this commit:
> 
> commit 28399f576f6389d20835cad7ee86f458880fdcda
> Author: Jerry D. Hedden <jdhedden at cpan.org>
> Date:   Tue Oct 2 18:58:32 2012 -0400
> 
>     Upgrade to threads::shared 1.42
> 
> 
> That commit has this:
> 
> -STATIC SV *
> -S_sharedsv_from_obj(pTHX_ SV *sv)
> -{
> -     return ((SvROK(sv)) ? INT2PTR(SV *, SvIV(SvRV(sv))) : NULL);
> -}
> +#define SHAREDSV_FROM_OBJ(sv) ((SvROK(sv)) ? INT2PTR(SV *, SvIV(SvRV(sv))) : NULL)
> 
> So you might be OK changing all SHAREDSV_FROM_OBJ(sv) to
> S_sharedsv_from_obj(aTHX_ sv)

Aha. Thanks for the hint! I've updated the patch and the this now
builds and tests okay against 5.14.2-21:

http://anonscm.debian.org/gitweb/?p=perl/perl.git;a=shortlog;h=refs/heads/bug-718438

And the original test case from the reporter on the Debian bug now
succeeds.

Cheers,
Dominic.




More information about the Perl-maintainers mailing list