On Mon, 19 Jun 2000, Mark-Jason Dominus wrote:

> 
> My program produces this message, and I'm trying to understand why.
> The first step is to find out which scalar it is complaining about.  I
> haven't been able to do this.  I can use the C debugger to step into
> my XS code, and everything looks OK;  I've used Devel::Peek on the
> variables I suspect, and they look OK.  Finally I tried placing a C
> breakpoint on the line that actually prints the 'unreferenced scalar'
> message in sv.c, and to my dismay the message appeared and the
> debugger never stopped at the breakpoint!
> 
> Does anyone have any suggestions about how to track this down?

It generally means you've got bad refcounts on some variables you've
created, or mortalized (or failed to mortalize) something incorrectly.
What I like to do is scatter sv_dump() calls all over the place
to make sure the refcounts are proper and, if that doesn't work, throw
together a DESTROY sub in a sub-package somewhere and bless the variables
I question into it. The DESTROY sub is set to print something useful
(sometimes printing *anything* is useful) and hopefully help track down
the problem.

                                Dan

Reply via email to