On Wed, Aug 02, 2006 at 02:35:06PM -0400, Mark T. Kennedy wrote:
> however, the callback in the complex program SEGV's within
> 'call_pv'. here is the source that causes the crash:
>
> void pass_to_perl (void *p)
> {
> Inline_Stack_Vars;
> Inline_Stack_Push (newSVpvf ("this is an arg string"));
you probably don't want to be using newSVpvf here. It's akin to using C's
fprintf() when really you wanted fputs() (with all the same rogue format
string errors.
> Inline_Stack_Done;
> call_pv ("main::callback", 0);
> Inline_Stack_Void;
> }
>
> if i run the complex program with a perl binary compiled
> with "-g -DDEBUGGING", i get the error message:
>
> Event: trapped error in `Handler': panic: memory wrap at ./xx line 162.
>
> the stack trace from the optimized perl binary when it SEGV's looks
> like this:
> this has me stopped cold. any thoughts/suggestions? any way
> to get more info?
Given that you have the debugging version, you'll get more information from
that. Run the code under the debugger, with a breakpoint on
Perl_croak_nocontext() [The function is called by the wrap checks. The wrap
check macros are in handy.h]
Then you should be able to get the offending line in the C code, and the
bogus length which is triggering the problems.
Nicholas Clark