Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40392] [CAGE] convert C<internal_exception> to C<real_exception>

8 views
Skip to first unread message

Jerry Gay

unread,
Sep 21, 2006, 5:38:40 PM9/21/06
to bugs-bi...@rt.perl.org
# 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?

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

Bob Rogers

unread,
Sep 23, 2006, 11:15:27 AM9/23/06
to perl6-i...@perl.org, bugs-bi...@rt.perl.org
From: Jerry Gay (via RT) <parrotbug...@parrotcode.org>
Date: Thu, 21 Sep 2006 14:38:40 -0700

# 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/

Jerry Gay

unread,
Jun 26, 2007, 9:35:58 AM6/26/07
to parrotbug...@parrotcode.org, perl6-i...@perl.org
On 6/26/07, Paul Cochrane via RT <parrotbug...@parrotcode.org> wrote:

> On Thu Sep 21 14:38:40 2006, particle wrote:
> > 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>
>
> As of r19331 there are 190 files affected. The complete list I'm
> attaching to this ticket. As I get time, I'm going to attack this
> ticket directory by directory.
>
fab. the safest place to start (least likely to run into cases where
we *need* internal_exception) is probably src/pmc.
~jerry

Jerry Gay

unread,
Jun 26, 2007, 4:48:22 PM6/26/07
to parrotbug...@parrotcode.org, perl6-i...@perl.org
On 6/26/07, Paul Cochrane via RT <parrotbug...@parrotcode.org> wrote:
> On Tue Jun 26 13:35:51 2007, ptc wrote:
> > On Tue Jun 26 06:36:50 2007, particle wrote:
> > > On 6/26/07, Paul Cochrane via RT <parrotbug-followup <!-- x --> at
> > Attached is a patch for the pmc's. Effectively everything under src/
> > pmc but also the relevant perl modules have been changed under lib/
>
> And this patch is for the dynamic pmc's which should really have been
> added with the last patch.
>
looks great, apply away!
~jerry

Paul Cochrane via RT

unread,
Jul 13, 2007, 3:39:03 AM7/13/07
to perl6-i...@perl.org
On Tue Jun 26 02:36:59 2007, ptc wrote:
> On Thu Sep 21 14:38:40 2006, particle wrote:
> > 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>
>
> As of r19331 there are 190 files affected. The complete list I'm
> attaching to this ticket. As I get time, I'm going to attack this
> ticket directory by directory.

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).


0 new messages