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

[COMMIT] Parrot catches null Px register access

5 views
Skip to first unread message

Melvin Smith

unread,
Oct 27, 2003, 10:40:45 PM10/27/03
to perl6-i...@perl.org, dan Sugalski, leopold Toetsch
Just in time for the "screamin' punkin" release....

I've patched in a quick and dirty implementation of the previous
discussion regarding Parrot segfaulting on access to a null register.
Of course, HLL compilers shouldn't generate code that results in
an uninitialized Px register, but we would like to do something more
elegant than just dump core.

You'll have to edit interpreter.h and set PARROT_CATCH_NULL to 1
to enable it.

The patch adds the Null PMC class, only instantiated once in
system memory. PMC register banks are set to PMCNULL now.
The null op returns PMCNULL as well. Also patched it into extend.c
so extension writers can get at it.

I didn't turn it on by default yet as we need to check over the code
to see where assumptions are being made about PMC pointers
just being NULL. However, all tests pass except the pmc create test
(you can't do a new .Null).

This is good enough to start, I think.
We should also integrate the null.pmc generation into pmc2c or pmc2c2.

-Melvin

Leopold Toetsch

unread,
Oct 28, 2003, 6:30:40 AM10/28/03
to Melvin Smith, perl6-i...@perl.org
Melvin Smith <mrjol...@mindspring.com> wrote:
> Just in time for the "screamin' punkin" release....

> You'll have to edit interpreter.h and set PARROT_CATCH_NULL to 1
> to enable it.

Turned on now by default.

> The patch adds the Null PMC class, only instantiated once in
> system memory.

... which was the main problem with the patch. PMCs have to point to
pool memory to make DOD happy. It could have been ok, if the live bit
was set - anyway, I use a constant PMC now, which isn't freed.

> I didn't turn it on by default yet as we need to check over the code
> to see where assumptions are being made about PMC pointers

> just being NULL...

I've fixed all locations, where NULL PMCs are either used or tested,
except these I forgot :)

Plain nci code needs still fixing, JIT/i386 nci is done.

> ... However, all tests pass except the pmc create test


> (you can't do a new .Null).

Did you really run tests with --gc-debug?

> This is good enough to start, I think.

Yep, works fine, thanks for putting all together.

> We should also integrate the null.pmc generation into pmc2c or pmc2c2.

We should really switch to the latter and only put in there.

> -Melvin

leo

Melvin Smith

unread,
Oct 28, 2003, 10:11:49 AM10/28/03
to l...@toetsch.at, perl6-i...@perl.org
At 12:30 PM 10/28/2003 +0100, Leopold Toetsch wrote:

>Melvin Smith <mrjol...@mindspring.com> wrote:
> > You'll have to edit interpreter.h and set PARROT_CATCH_NULL to 1
> > to enable it.
>
>Turned on now by default.

Good.

> > The patch adds the Null PMC class, only instantiated once in
> > system memory.
>
>... which was the main problem with the patch. PMCs have to point to
>pool memory to make DOD happy. It could have been ok, if the live bit
>was set - anyway, I use a constant PMC now, which isn't freed.

I figured, but I'm so rusty I can't remember anything.

> > I didn't turn it on by default yet as we need to check over the code
> > to see where assumptions are being made about PMC pointers
> > just being NULL...
>
>I've fixed all locations, where NULL PMCs are either used or tested,
>except these I forgot :)
>
>Plain nci code needs still fixing, JIT/i386 nci is done.

I saw these, thanks. I figure there are still some spots hiding
that I forgot as well.

>Did you really run tests with --gc-debug?

Nope. Just did the default tests.

> > We should also integrate the null.pmc generation into pmc2c or pmc2c2.
>
>We should really switch to the latter and only put in there.

I wasn't even sure which one was used. We should remove one of them.
I'm also trying to sprinkle some comments here or there as I make my
way back through the code but it is slow going.

Thanks for fixing up the patch,

-Melvin


0 new messages