You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hsperl_init C function is poorly behaved in the event it fails to parse a given Perl-code "preamble": (a) it prints to stderr, bad behaviour for a library, and (b) calls exit(), terminating the whole process. See here:
if (SvTRUE(ERRSV)) {
STRLENn_a;
// TODO: see if we can raise a proper exception insteadfprintf(stderr, "Error init perl: %s\n", SvPV(ERRSV,n_a));
// NO. Should _NOT_ be aborting, mid-program.exit(1);
}
This should be fixed – we should indicate errors through our return value. Either we can return a NULL pointer on error, and provide an "out" parameter where an error code can be set; or we can have an int return value (0 for success, anything else for failure) and return the Interpreter pointer via an Interpreter **.
The particular condition above is admittedly unlikely to occur – unless the preamble being parsed is deliberately changed, Perl should always be able to parse it – so this is low-ish priority, but no doubt there are other errors in hsperl_init we're not currently checking for.
The text was updated successfully, but these errors were encountered:
The
hsperl_init
C function is poorly behaved in the event it fails to parse a given Perl-code "preamble": (a) it prints to stderr, bad behaviour for a library, and (b) callsexit()
, terminating the whole process. See here:This should be fixed – we should indicate errors through our return value. Either we can return a
NULL
pointer on error, and provide an "out" parameter where an error code can be set; or we can have anint
return value (0 for success, anything else for failure) and return the Interpreter pointer via anInterpreter **
.The particular condition above is admittedly unlikely to occur – unless the preamble being parsed is deliberately changed, Perl should always be able to parse it – so this is low-ish priority, but no doubt there are other errors in
hsperl_init
we're not currently checking for.The text was updated successfully, but these errors were encountered: