develooper Front page | perl.perl5.porters | Postings from May 2004

Re: [perl #29939] threads::shared use of XSLoader breaks Devel::DProf

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
May 30, 2004 15:38
Subject:
Re: [perl #29939] threads::shared use of XSLoader breaks Devel::DProf
Message ID:
20040530224451.GF1901@iabyn.com
On Fri, May 28, 2004 at 11:07:28PM -0000, Norbert wrote:
> I can't run the Devel::DProf profiler on any script that uses 
> threads/shared.pm, because that lib loads itself using
> XSLoader::load().  This function is written such that it bumps
> up against a DProf bug, whereby it chokes on subroutines that
> end with a last, goto, or next.
(snip)
> I suppose that if this problem is going to be fixed in DProf 
> then this is just a duplicate bug, but I would suggest that 
> this issue increases the severity, since the major question 
> marks about ithreads seems to revolve around memory usage, 
> which DProf is useful for checking.

Thanks for the report. yes, this does seem to be the same problem.

P5Pers: the root problem seems to be that whenever pp_entersub is invoked,
it calls DB::sub rather than the the real sub, and it is left to DB::sub
to then invoke the real sub, which can be tricky when that real sub may do
various stuff that will unwind the CX stack (like goto &foo, last, die).

I'd have thought a better way would be to provide an additional C-level
hook that gets called by entersub before it (ie entersub) then proceeds to
call the real sub as usual.

I havn't looked into this closely, though. I'm hoping someone with some
more experience in this area might comment.

Dave.

-- 
The Enterprise is involved in a bizarre time-warp experience which is in
some way unconnected with the Late 20th Century.
    -- Things That Never Happen in "Star Trek" #14

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