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

[perl #39072] [BUG] Unable to load_bytecode :multi after PGE.pbc

8 views
Skip to first unread message

Patrick R . Michaud

unread,
May 4, 2006, 2:13:49 AM5/4/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Patrick R. Michaud
# Please include the string: [perl #39072]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39072 >


I've been unable to get pheme to run on my system, and after
chromatic and I did some testing tonight we think we've narrowed
the problem down to an issue with using load_bytecode on files
containing :multi subs.

The example here are all using r12492. Here's my short test
program that evokes the bug:

$ cat foo.pir
.sub 'foo' :multi(string)
.param string x
say "foo"
say "does"
print x
print "\n"
.end
$ cat x.pir
.sub main :main
load_bytecode 'PGE.pbc'
load_bytecode 'foo.pir'

say "Hello\n"
.end

When running on x86 (32-bit), I get:

$ ./parrot x.pir
ResizablePMCArray: index out of bounds!
current instr.: 'main' pc -1 ((unknown file):-1)
$

A trace shows that it fails at the load_bytecode 'foo.pir' step.

Under x86-64, it fails at the same point but with a different
message:

$ ./parrot x.pir
Parrot VM: PANIC: Out of mem!
C file src/memory.c, line 122
Parrot file (not available), line (not available)
[..rest omitted for brevity..]

I haven't been able to reproduce this failure with any .pbc
file other than PGE.pbc. (I can't think of anything in PGE.pbc
that would cause this, other than it's a fairly large .pbc file.)
Switching the files to be .pir instead of .pbc or vice-versa
doesn't seem to affect t hings.

Surprisingly, adding *more* load_bytecode instructions between
the loads of 'PGE.pbc' and 'foo.pir' seems to help:

$ cat y.pir
.sub main :main
load_bytecode 'PGE.pbc'
load_bytecode 'ncurses.pbc'
load_bytecode 'Getopt/Obj.pbc'
load_bytecode 'foo.pir'

say "Hello\n"
.end
$ ./parrot y.pir
Hello

$

Loading other .pbc or .pir files that do not have :multi subs
seems to not be a problem; at least, I've only encountered the
problem when a load_bytecode encounters a :multi. And
commenting out any :multi causes the error to go away.

Pm

Chromatic

unread,
May 4, 2006, 2:43:15 AM5/4/06
to perl6-i...@perl.org, Patrick R.Michaud, bugs-bi...@rt.perl.org
On Wednesday 03 May 2006 23:13, Patrick R.Michaud wrote:

> When running on x86 (32-bit), I get:
>
> $ ./parrot x.pir
> ResizablePMCArray: index out of bounds!
> current instr.: 'main' pc -1 ((unknown file):-1)
> $

I see this too on x86, running t/car.t through Pheme. I traced the C to
compilers/imcc/imclexer.c:5575 (the yyparse() call). That's as far as I want
to go.

-- c

Leopold Toetsch

unread,
May 10, 2006, 6:50:44 AM5/10/06
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
Patrick R.Michaud (via RT) wrote:
> # New Ticket Created by Patrick R. Michaud
> # Please include the string: [perl #39072]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39072 >
>
>
> I've been unable to get pheme to run on my system, and after
> chromatic and I did some testing tonight we think we've narrowed
> the problem down to an issue with using load_bytecode on files
> containing :multi subs.

Fixed (r12593), thanks for the testcase.

> Pm

leo

0 new messages