jalopeura has asked for the wisdom of the Perl Monks concerning the following question:
I'm having a problem with some XS that is some kind of perl stack issue. It doesn't always happen in the same XSUB, but I always get a usage error from the XSUB when it happens. The fact that it doesn't happen in the same XSUB means I don't know what code is causing it, so I can't supply code.
In one case, I have CPP code calling a method on a perl object; I have provided a base class with a default XS version of that method. If I don't provide that method in my subclass, the error can actually happen without going to Perl code at all.
I am able to reproduce the error, and so I examined the items variable (by altering the c file generated from the XS and then recompiling), and it was negative. However, these are method calls (but not always from the same class), so the blessed reference HAS to be on the stack, or Perl wouldn't have called the XSUB in the first place.
Since this is XS, my first thought is that I've messed up refcounts and mortality. But would that affect the items variable? What else might be the problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl stack issue
by BrowserUk (Patriarch) on Jun 06, 2011 at 22:02 UTC | |
by jalopeura (Initiate) on Jun 07, 2011 at 06:44 UTC | |
by BrowserUk (Patriarch) on Jun 07, 2011 at 07:29 UTC | |
by Anonymous Monk on Jun 07, 2011 at 08:04 UTC | |
by BrowserUk (Patriarch) on Jun 07, 2011 at 08:42 UTC | |
by Corion (Patriarch) on Jun 07, 2011 at 06:51 UTC |