develooper Front page | perl.perl5.porters | Postings from September 2013

RE: [perl #119617] PerlEmbed 5.14: sv_setsv(ERRSV, &PL_sv_undef); crashes on Linux

Thread Next
From:
John Unsworth
Date:
September 10, 2013 15:40
Subject:
RE: [perl #119617] PerlEmbed 5.14: sv_setsv(ERRSV, &PL_sv_undef); crashes on Linux
Message ID:
000001ceadf7$9f3ebf60$ddbc3e20$@cp.net
Hi Tony,

We do use G_KEEPERR because we want to report error details. I did send a response to Jim - but the example I tried to create on Windows crashes on the call to CLEAR_ERRSV() and I don't know why.

Regards,
John.

-----Original Message-----
From: Tony Cook via RT [mailto:perlbug-followup@perl.org] 
Sent: 10 September 2013 02:46
To: john.unsworth@cp.net
Subject: [perl #119617] PerlEmbed 5.14: sv_setsv(ERRSV, &PL_sv_undef); crashes on Linux

On Thu Sep 05 04:18:28 2013, john.unsworth@cp.net wrote:
<snip>
> So it seems that the implementation of ERRSV has changed in that at
5.14 it
> is not initially defined, hence I assume that sv_setsv(ERRSV,
&PL_sv_undef);
> was trying to set an undefined variable and thus causing the error. 
> The correct fix seems to be to change this to CLEAR_ERRSV(). Shouldn't 
> this be mentioned in the embed documentation? There is no mention at 
> all of how to reset the error variable.

Why do you need to clear ERRSV?

It should be cleared by eval_sv() or call_sv() on success (unless you use G_KEEPERR).

While I think documenting CLEAR_ERRSV() is useful, I'm not sure where you'd need to use it outside the core.

The example code Jim asked for would be useful.

Tony


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About