develooper Front page | perl.perl5.porters | Postings from October 2015

Re: [perl #126273] [PATCH] WIP add save stack caller tracing

Thread Previous
Dave Mitchell
October 6, 2015 10:22
Re: [perl #126273] [PATCH] WIP add save stack caller tracing
Message ID:
On Mon, Oct 05, 2015 at 11:51:43AM -0700, bulk88 wrote:
> See attached patch. This patch was created since 
> took too much time 
> for me to debug, and Test::Stream is revealing more psuedofork save 
> stack related panic/assert fails/heap corruption/segvs in 2015 (that is 
> another bug ticket for me to file). So this patch decrease the amount of 
> time to diagnose save stack problems.

Um, this seems a bit invasive. Would it be possible instead, to

1. If you're just interested in finding when a particular SS frame of
interest was pushed:

On debugging builds, have a var, PL_savestack_serial say, which is
incremented and pushed onto the SS at the same time the SS action is.
Then to find where a particular frame comes from, look at the serial
number, then rerun the program with a watchppoint to trigger when
PL_savestack_serial gets that value.

2. If you need to do more general introspection (e.g. a full stack dump
showing where each frame came from):

On debugging builds, have a fake save type, SAVEt_DEBUGINFO say, along with
an associated save function and macro, that can be used to push that info
on the savestack; e.g.

    #ifdef DEBUGGING
    #  define SAVEDEBUGINFO() save_debuginfo(__LINE__, __FILE__)

    Perl_save_debuginfo(pTHX_ char *file, int line)

    #  define SAVEDEBUGINFO() NOOP;

Then just update the SAVEFOO macros to be, e.g.

#define SAVEI8(i)	save_I8((I8*)&(i)); SAVEDEBUGINFO

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

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About