You can use inline::C to provide test/demo scripts that we can all run (if Inline::C is installed).
The following runs fine for me on both perl-5.8.9 and perl-5.10. Do you still get the crash ?
use warnings; use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'EOC'; void call_Subtract(int a , int b) { dSP; int count; ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSViv(a))); XPUSHs(sv_2mortal(newSViv(b))); PUTBACK; printf("PL_errgv2 = %p\n", PL_errgv); //count = call_pv("Subtract", G_EVAL|G_SCALAR); count = call_pv("Subtract", G_SCALAR); SPAGAIN; printf("PL_errgv3 = %p\n", PL_errgv); /* Check the eval first */ if (SvTRUE(ERRSV)) /* crashes here */ { STRLEN n_a; printf ("Uh oh - %s\n", SvPV(ERRSV, n_a)); POPs; } else { if (count != 1) croak("call_Subtract: wanted 1 value from 'Subtract', g +ot %d\n", count); printf ("%d - %d = %d\n", a, b, POPi); } PUTBACK; FREETMPS; LEAVE; } EOC call_Subtract(25, 12); sub Subtract { my $ret = $_[0] - $_[1]; return $ret; }
It ouptuts, for me:
PL_errgv2 = 002E3F20 PL_errgv3 = 002E3F20 25 - 12 = 13
Cheers,
Rob

In reply to Re: SvTRUE(ERRSV) crsahes in Perl 5.10 by syphilis
in thread SvTRUE(ERRSV) crsahes in Perl 5.10 by mcaisuca

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.