Skip Menu |
Report information
Id: 127473
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
From: Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko [...] gmail.com>
Date: Sat, 6 Feb 2016 01:45:03 +0200
Subject: [BUG] Rakudo explodes if you run (;)
Download (untitled) / with headers
text/plain 2.2k
But let's start with something less impressive.

Code:
say [;0]

Result:
Non ast passed to WANTED: BOOTInt
Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Weird node in analyze: BOOTInt
===SORRY!===
Unknown QAST node type BOOTInt


Woah! Ok, let's try this.

Code:
[;]

Result:
Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Weird node in analyze: BOOTInt
===SORRY!===
Unknown QAST node type BOOTInt

Okay, that's a bit less impressive. Let's try with ()

Code:
(;)

Result:
Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Resultchild 0 can't returns! BOOTInt
- QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;)
  - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;)
    - 0

Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Resultchild 0 can't returns! BOOTInt
- QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;)
  - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;)
    - 0

Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Resultchild 0 can't returns! BOOTInt
- QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;)
  - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;)
    - 0

Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Resultchild 0 can't returns! BOOTInt
- QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;)
  - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;)
    - 0

Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Resultchild 0 can't returns! BOOTInt
- QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;)
  - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;)
    - 0

Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Resultchild 0 can't returns! BOOTInt
- QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;)
  - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;)
    - 0

Non-QAST node visited BOOTInt
Weird node visited: BOOTInt
Resultchild 0 can't returns! BOOTInt
- QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;)
  - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;)
    - 0

… and so on.

Of course, the output is more impressive if you have some other code in the same file.
To: rakudobug [...] perl.org
Date: Tue, 14 Jun 2016 15:19:17 +0100
Subject: [BUG] (;;) makes compiler barf
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 465b
$ perl6 -e '(;;)' Non ast passed to UNWANTED: BOOTInt Non ast passed to UNWANTED: BOOTInt Non-QAST node visited BOOTInt Weird node visited: BOOTInt Non-QAST node visited BOOTInt Weird node visited: BOOTInt Non-QAST node visited BOOTInt Weird node visited: BOOTInt Non-QAST node visited BOOTInt Weird node visited: BOOTInt Weird node in analyze: BOOTInt ===SORRY!=== Unknown QAST node type BOOTInt $ '(;)' yields worse misbehaviour, with an infinite loop. -zefram
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 2.8k
On Fri Feb 05 15:45:19 2016, alex.jakimenko@gmail.com wrote: Show quoted text
> But let's start with something less impressive. > > Code: > say [;0] > > Result: > Non ast passed to WANTED: BOOTInt > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Weird node in analyze: BOOTInt > ===SORRY!=== > Unknown QAST node type BOOTInt > > > Woah! Ok, let's try this. > > Code: > [;] > > Result: > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Weird node in analyze: BOOTInt > ===SORRY!=== > Unknown QAST node type BOOTInt > > Okay, that's a bit less impressive. Let's try with () > > Code: > (;) > > Result: > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Resultchild 0 can't returns! BOOTInt > - QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;) > - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;) > - 0 > > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Resultchild 0 can't returns! BOOTInt > - QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;) > - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;) > - 0 > > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Resultchild 0 can't returns! BOOTInt > - QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;) > - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;) > - 0 > > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Resultchild 0 can't returns! BOOTInt > - QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;) > - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;) > - 0 > > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Resultchild 0 can't returns! BOOTInt > - QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;) > - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;) > - 0 > > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Resultchild 0 can't returns! BOOTInt > - QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;) > - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;) > - 0 > > Non-QAST node visited BOOTInt > Weird node visited: BOOTInt > Resultchild 0 can't returns! BOOTInt > - QAST::Stmts :BY<comp_unit ua u> :context<sink> #!/usr/bin/env perl6\n(;) > - QAST::Stmt :BY<comp_unit ua u u> :context<sink> :final (;) > - 0 > > … and so on. > > Of course, the output is more impressive if you have some other code in the > same file.
Fixed it so: * We won't infinite loop in that place if we hit it again * We don't do the debug spam in the optimizer, unless the debug environment variable is turned on * We don't go sticking a raw integer into the AST on such constructs, which is what caused all the trouble in the first place Tests in integration/weird-errors.t.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org