parrot's source is littered with internal_exception() calls, the bulk
(all?) of which should be converted to real_exception() calls.
internal exceptions are uncatchable, and might as well be called
C<exit>. that's bad, ya dig?
there are plenty of examples of calls to real_exception() so it should
be an easy task for the willing. look in
F<include/parrot/exceptions.h> for a list of exception constants.
convert to E_FooError types where possible.
for an example commit of a modification, C<svn diff -c 14680>, or if
you don't have svn 1.4.0 yet (why not?) C<svn diff -r 14679:14680>
~jerry
# New Ticket Created by Jerry Gay
# Please include the string: [perl #40392]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40392 >
parrot's source is littered with internal_exception() calls, the bulk
(all?) of which should be converted to real_exception() calls.
internal exceptions are uncatchable, and might as well be called
C<exit>. that's bad, ya dig?
Waay bad, and wicked hard to debug; this is an excellent cage-cleaning
job.
But, for the record, there are cases where internal_exception() (aka
"exit") is necessary. For example, in Continuation:invoke :
if (! from_ctx->control_stack)
internal_exception(1, "Control stack damaged");
Since real_exception requires a working control stack, parrot has no
choice but to bail -- and similarly for most places in GC, I'll bet.
Anything that sniffs of corruption is probably best to leave alone,
IMHO.
-- Bob Rogers
http://rgrjr.dyndns.org/
Here is an update as to the current status of this ticket.
As of r19821 the only files now affected are outlined as follows:
src/thread.c
- can't change internal_exception()s to real_exception()s as they
occur in pt_check_tid() which returns a Parrot_Interp anyway.
src/events.c
- I'm not able to change the only occurrence here as it is Win32-
specific (I'm on Linux x86) and hence is untestable
src/tsq.c
- one occurrence in queue_destroy(). Things get tricky very quickly
here as the queue_destroy() would also need an interp passed in as an
argument, so I decided not to change this one. I can still do it if
people want, it's just a bit hairy and likely to not bring much in the
end.
config/gen/platform/win32/exec.c
config/gen/platform/win32/stat.c
- I can't test these files as they're win32. They also need the
"interpreter" variable renamed to "interp"
src/jit/sun4/jit_emit.h
src/jit/mips/jit_emit.h
src/jit/hppa/jit_emit.h
src/jit/alpha/jit_emit.h
src/jit/ia64/jit_emit.h
src/jit/ppc/jit_emit.h
src/jit/arm/jit_emit.h
- I can't change or test these since I don't have the right
platform. Anyone willing to take this on?
src/packfile/pf_items.c
- One instance, still needs to be attended to (I'll try to get around
to it, but there are a lot of enclosing functions/macros so the change
might not be worth it).