develooper Front page | perl.perl5.porters | Postings from March 2017

Re: [perl #78192] gv_try_downgrade leaves dangling pointers duringglobal destruction

From:
Dave Mitchell
Date:
March 28, 2017 11:35
Subject:
Re: [perl #78192] gv_try_downgrade leaves dangling pointers duringglobal destruction
Message ID:
20170328113544.GX3342@iabyn.com
On Sat, Jan 07, 2017 at 05:59:55PM +0000, Aaron Crane wrote:
> James E Keenan via RT <perlbug-followup@perl.org> wrote:
> > While 'PL_dirty' still exists in C code underneath cpan/, dist/ and ext/, it no longer exists in gv.c or other core C files.  Consequently, I can no longer reproduce the problem in the manner advised more than 6 years ago.
> >
> > Is the ticket closable?
> 
> It still has a stub definition in perl.h that's only made available to
> XS modules, rather than being used in the core directly:
> 
> #ifndef PERL_CORE
> /* Do not use this macro. It only exists for extensions that rely on PL_dirty
>  * instead of using the newer PL_phase, which provides everything PL_dirty
>  * provided, and more. */
> #  define PL_dirty cBOOL(PL_phase == PERL_PHASE_DESTRUCT)
> 
> #  define PL_amagic_generation PL_na
> #  define PL_encoding ((SV *)NULL)
> #endif /* !PERL_CORE */
> 
> The Perl_gv_try_downgrade() function still has the equivalent logic to
> avoid these dangling pointers:
> 
>     /* XXX Why and where does this leave dangling pointers during global
>        destruction? */
>     if (PL_phase == PERL_PHASE_DESTRUCT) return;
> 
> However, commenting that out doesn't allow me to reproduce the
> behaviour described, either. Maybe sprout can shed some light on this
> situation.

I can reproduce it on the old commit sprout mentioned as when the problem
started (13be902) but not blead.

In the absence of any contrary information, I'm marking this ticket
closed.

-- 
In England there is a special word which means the last sunshine
of the summer. That word is "spring".



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About