Skip to content

Instantly share code, notes, and snippets.

@usev6
Last active December 11, 2015 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usev6/6280b4010aabeada760f to your computer and use it in GitHub Desktop.
Save usev6/6280b4010aabeada760f to your computer and use it in GitHub Desktop.
weird aborts with routine 'supply'
While trying to golf spectest failures in S17-supply/syntax.t I found some really weird behaviour.
Consider the following program 'S17-supply_syntax_golf.p6':
====
use v6;
for ^1 { my $foo };
my $a = supply { };
my $b = supply { };
my $c = supply { };
my $d = supply { };
my $e = supply { };
my $f = supply { };
my $g = supply { };
my $h = supply { };
my $i = supply { };
my $j = supply { };
my $k = supply { };
my $l = supply { };
my $m = supply { emit 42 };
my $two = supply { emit 43; done }
$a.tap({ 4 });
$a.tap({ 4 });
$a.tap({ 4 });
$a.tap({ 4 });
$a.tap({ 4 });
$a.tap({ 4 });
$a.tap({ 4 });
$a.tap({ 4 });
$a.tap({ 4 });
$two.tap({ 4 });
$two.tap({ 4 });
====
Running this program aborts on MoarVM, running on Debian 7 (but completes on JVM, also completes on MoarVM on FreeBSD 10.2):
$ ./perl6-m --version
This is rakudo version 2015.11-401-g0a2303c built on MoarVM version 2015.11-34-gc3eea17 implementing Perl v6.b.
$ ./perl6-m S17-supply_syntax_golf.pl6
Aborted
Using git bisect it looks like the aborts start with commit 0a2303c0f6a2a3782fecb13db1523cb5442467de.
Nearly all changes to the program make the abort vanish:
* removing any line (including 'use v6')
* adding a semicolon at the end of line 18 (declaration of $two)
* changing one of the unused Supplies -- eg 'my $b = supply { emit 41 }';
The abort also vanishes when run with 'MVM_SPESH_DISABLE=1':
$ MVM_SPESH_DISABLE=1 ./perl6-m S17-supply_syntax_golf.pl6
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment