# New Ticket Created by Richard Hainsworth
# Please include the string: [perl #66136]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=66136 >
a) The first bug report was sent to rakudobug without [BUG] prefix and
registered with ticket
ID of [perl #65956]. Sorry.
b) First script seg_test.p6
Slightly rewrote script, and still got memory error. See seg_text_v2.p6 (which
also contains the output)
The following script (also attached) generated a Parrot memory fault.
I was trying to find a small script to generate a segfault I was getting
with a more complex perl6 script.
It generated the following response:
Iteration 1
... (lines cut)
Iteration 147
Iteration 148
Parrot VM: PANIC: Out of mem!
C file src/gc/memory.c, line 142
Parrot file (not available), line (not available)
We highly suggest you notify the Parrot team if you have not been working on
Parrot. Use parrotbug (located in parrot's root directory) or send an
e-mail to parrot-...@lists.parrot.org.
Include the entire text of this error message and the text of the script
that
generated the error. If you've made any modifications to Parrot, please
describe them as well.
Version : 1.1.0-devel
Configured : Mon May 18 18:41:44 2009 GMT
Architecture: i386-linux
JIT Capable : Yes
Interp Flags: (no interpreter)
Exceptions : (missing from core)
Dumping Core...
Quit
<script>
my %x = ('A' X~ 0..200) Z (200..400);
my @z = (1 .. 201);
my %y;
my $count = 0;
loop {
say "Iteration {++$count}";
%y = foo1(%x,@z);
%y = foo2(%x,@z);
%y = foo3(%x,@z);
};
sub foo1(%a,@b) {
my %b = map {; $^a => %a{$^a} + @b[$^b] }, (%a.keys Z 0..^ @b.elems);
return %b;
};
sub foo2(%b,@c) {
my %d = map {; $^a => %b{$^a} + @c[$^b] }, (%b.keys Z 0..^ @c.elems);
return %d;
};
sub foo3(%d,@e) {
my %f = map {; $^a => %d{$^a} + @e[$^b] }, (%d.keys Z 0..^ @e.elems);
return %f;
};
#to get segmentation fault
my %x = ('A' X~ 0..200) Z (200..400);
my @z = (1 .. 201);
my %y;
my $count = 0;
loop {
say "Iteration {++$count}";
%y = foo1(%x,@z);
%y = foo2(%x,@z);
%y = foo3(%x,@z);
};
sub foo1(%a,@b) {
my %b = map {; $^a => %a{$^a} + @b[$^b] }, (%a.keys Z 0..^ @b.elems);
return %b;
};
sub foo2(%b,@c) {
my %d = map {; $^a => %b{$^a} + @c[$^b] }, (%b.keys Z 0..^ @c.elems);
return %d;
};
sub foo3(%d,@e) {
my %f = map {; $^a => %d{$^a} + @e[$^b] }, (%d.keys Z 0..^ @e.elems);
return %f;
};
#to get segmentation fault
my %x = ('A' X~ 0..200) Z (200..400);
my @z = (1 .. 201);
my %y;
my $count = 0;
loop {
say "Iteration {++$count}";
%y=();
foo1(%x,@z,%y);
%y=();
foo2(%x,@z,%y);
%y=();
foo3(%x,@z,%y);
};
sub foo1(%a,@b,%res is rw) {
%res = map {; $^a => %a{$^a} + @b[$^b] }, (%a.keys Z 0..^ @b.elems);
};
sub foo2(%b,@c,%res is rw) {
%res = map {; $^a => %b{$^a} + @c[$^b] }, (%b.keys Z 0..^ @c.elems);
};
sub foo3(%d,@e,%res is rw) {
%res = map {; $^a => %d{$^a} + @e[$^b] }, (%d.keys Z 0..^ @e.elems);
};
=begin results
Iteration 164
Iteration 165
Iteration 166
Parrot VM: PANIC: Out of mem!
C file src/gc/memory.c, line 142
Parrot file (not available), line (not available)
We highly suggest you notify the Parrot team if you have not been working on
Parrot. Use parrotbug (located in parrot's root directory) or send an
e-mail to parrot-...@lists.parrot.org.
Include the entire text of this error message and the text of the script that
generated the error. If you've made any modifications to Parrot, please
describe them as well.
Version : 1.1.0-devel
Configured : Mon May 18 18:41:44 2009 GMT
Architecture: i386-linux
JIT Capable : Yes
Interp Flags: (no interpreter)
Exceptions : (missing from core)
Dumping Core...
Quit
=end results