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

[perl #114990] Non assignment to *DB::DB causes segfault

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 24, 2012 09:43
Subject:
[perl #114990] Non assignment to *DB::DB causes segfault
Message ID:
rt-3.6.HEAD-11172-1348504974-1409.114990-15-0@perl.org
On Mon Sep 24 05:40:01 2012, b_jonas wrote:
> On Mon Sep 24 05:34:57 2012, b_jonas wrote:
> > On Fri Sep 21 05:35:18 2012, LeonT wrote:
> > > > cat Devel/foo.pm
> > > package Devel::foo;
> > > *DB::DB = sub {} if 0;
> > > 1;
> > > 
> > > > perl -d:foo -e0
> > > Segmentation fault (core dumped)
> > > 
> > > It seems pp_dbstate doesn't check it the &DB::DB is really defined,
> > > only that it has been seen.
> > 
> > This seems familiar.  Yup: bug #34892 -- a bug from years ago which
> > claims that declaring DB::sub without defining it can cause a
segfault.  
> > 
> > If you know what caused this bug, maybe check all the other debugger
> > callbacks for similar problems now.
> 
> In fact, you might be able to get a smaller test case for this bug using
> that knowledge.  Try this:
> 
> perl -we 'sub DB::DB; BEGIN { $^P = 0x22; } for (0 .. 9) { warn "hello
> world"; }'
> 
> This should give some kind of error or just print hello world ten times,
> but instead at least perl 5.14 seems to do nothing and exit
> successfully.  I don't have a more recent perl at hand to test now, sorry.

I’ve just fixed that in commit c2cb6f778e2.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: resolved
https://rt.perl.org:443/rt3/Ticket/Display.html?id=114990

Thread Previous | Thread Next


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