develooper Front page | perl.perl5.porters | Postings from September 2011

[perl #94510] bless() invoked in AUTOLOAD causes SEGV

From:
Father Chrysostomos via RT
Date:
September 18, 2011 13:34
Subject:
[perl #94510] bless() invoked in AUTOLOAD causes SEGV
Message ID:
rt-3.6.HEAD-31297-1316378053-34.94510-15-0@perl.org
On Tue Jul 12 21:19:22 2011, sortiz wrote:
> On 07/11/2011 09:32 AM, Rafael Garcia-Suarez wrote:
> > On 11 July 2011 11:41, stsc@refcnt.org<perlbug-followup@perl.org>
> wrote:
> >> [guest@testing ~]$ ./perl-7b70e81 -e 'AUTOLOAD { bless {} };
> __PACKAGE__->method'
> >> Segmentation fault
> > That segfaults during global destruction. Adding an empty
> > DESTROY method fixes the one-liner.
> >
> > A simpler way to trigger that bug, without autoloading :
> >
> >      ~� perl -e 'sub DESTROY { bless {} }; bless {}'
> >      Segmentation fault
> 
> Some guards against reentrance are required for "magic" functions.

But sometimes it is necessary for DESTROY, etc. to be recursive.  It’s
the user’s responsibility to make sure it doesn’t happen infinitely.

For me, the crash happens 102273 C function calls deep, which will
obviously not happen with working code.

Or do we want objects destroyed with DESTROY actually to remain alive
until DESTROY exits, so it is not called recursively?

I’m inclined to classify this bug as unfixable.






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