[perl #60160] [BUG] [PATCH] recursive "use" causes infinite loop.

2008-11-04 Thread [EMAIL PROTECTED] via RT
On Sun Oct 26 19:55:51 2008, [EMAIL PROTECTED] wrote:
> The following simple test involves two .pm files that depend on each  
> other.  In revision 32120, this causes an infinite loop.  The  
> attached trivial patch prevents the loop by making Rakudo mark the  
> modules as loaded before parsing them.  This is how Perl5 behaves.
> 
Looks good to me; applied in r32327.

Thanks!

Jonathan



[perl #60160] [BUG] [PATCH] recursive "use" causes infinite loop.

2008-10-27 Thread via RT
# New Ticket Created by  Chris Dolan 
# Please include the string:  [perl #60160]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=60160 >


The following simple test involves two .pm files that depend on each  
other.  In revision 32120, this causes an infinite loop.  The  
attached trivial patch prevents the loop by making Rakudo mark the  
modules as loaded before parsing them.  This is how Perl5 behaves.

=== File lib/One.pm ===
use v6;
use Two;
=== File lib/Two.pm ===
use v6;
use One;
=== File test.pl ===
use v6;
use One;


% env PERL6LIB=./lib perl6 test.pl

maximum recursion depth exceeded
current instr.: 'parrot;PGE;Match;new' pc 25 (compilers/pge/PGE/ 
Match.pir:54)
called from Sub 'parrot;Perl6;Grammar;pod_comment' pc 20852 (src/ 
gen_grammar.pir:981)
called from Sub 'parrot;Perl6;Grammar;unv' pc 20526 (src/ 
gen_grammar.pir:850)
called from Sub 'parrot;Perl6;Grammar;ws' pc 19642 (src/ 
gen_grammar.pir:487)
called from Sub 'parrot;Perl6;Grammar;MARK_STATEMENT_END' pc 26706  
(src/gen_grammar.pir:3276)
called from Sub 'parrot;Perl6;Grammar;TOP' pc 1 (src/ 
gen_grammar.pir:204)
called from Sub 'parrot;PCT;HLLCompiler;parse' pc 630 (src/PCT/ 
HLLCompiler.pir:384)
called from Sub 'parrot;PCT;HLLCompiler;compile' pc 433 (src/PCT/ 
HLLCompiler.pir:302)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 834 (src/PCT/ 
HLLCompiler.pir:490)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1138 (src/PCT/ 
HLLCompiler.pir:627)
called from Sub 'require' pc 13575 (src/gen_builtins.pir:8446)
called from Sub 'use' pc 13601 (src/gen_builtins.pir:8459)
called from Sub 'anon' pc 8 (EVAL_74:4)
called from Sub 'parrot;Perl6;Grammar;Actions;_block555' pc 104287  
(src/gen_actions.pir:1687)
called from Sub 'parrot;Perl6;Grammar;Actions;use_statement' pc  
104140 (src/gen_actions.pir:1639)
called from Sub 'parrot;Perl6;Grammar;use_statement' pc 43456 (src/ 
gen_grammar.pir:9625)
called from Sub 'parrot;Perl6;Grammar;statement_control' pc 32015  
(src/gen_grammar.pir:5227)
called from Sub 'parrot;Perl6;Grammar;statement' pc 26968 (src/ 
gen_grammar.pir:3386)
called from Sub 'parrot;Perl6;Grammar;statementlist' pc 25021 (src/ 
gen_grammar.pir:2618)
called from Sub 'parrot;Perl6;Grammar;statement_block' pc 23060 (src/ 
gen_grammar.pir:1846)
called from Sub 'parrot;Perl6;Grammar;TOP' pc 18954 (src/ 
gen_grammar.pir:228)
called from Sub 'parrot;PCT;HLLCompiler;parse' pc 630 (src/PCT/ 
HLLCompiler.pir:384)
called from Sub 'parrot;PCT;HLLCompiler;compile' pc 433 (src/PCT/ 
HLLCompiler.pir:302)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 834 (src/PCT/ 
HLLCompiler.pir:490)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1138 (src/PCT/ 
HLLCompiler.pir:627)
called from Sub 'require' pc 13575 (src/gen_builtins.pir:8446)
called from Sub 'use' pc 13601 (src/gen_builtins.pir:8459)
called from Sub 'anon' pc 8 (EVAL_73:4)
[ ... 942 lines deleted ... ]
called from Sub 'require' pc 13575 (src/gen_builtins.pir:8446)
called from Sub 'use' pc 13601 (src/gen_builtins.pir:8459)
called from Sub 'anon' pc 8 (EVAL_10:4)
called from Sub 'parrot;Perl6;Grammar;Actions;_block555' pc 104287  
(src/gen_actions.pir:1687)
called from Sub 'parrot;Perl6;Grammar;Actions;use_statement' pc  
104140 (src/gen_actions.pir:1639)
called from Sub 'parrot;Perl6;Grammar;use_statement' pc 43456 (src/ 
gen_grammar.pir:9625)
called from Sub 'parrot;Perl6;Grammar;statement_control' pc 32015  
(src/gen_grammar.pir:5227)
called from Sub 'parrot;Perl6;Grammar;statement' pc 26968 (src/ 
gen_grammar.pir:3386)
called from Sub 'parrot;Perl6;Grammar;statementlist' pc 25021 (src/ 
gen_grammar.pir:2618)
called from Sub 'parrot;Perl6;Grammar;statement_block' pc 23060 (src/ 
gen_grammar.pir:1846)
called from Sub 'parrot;Perl6;Grammar;TOP' pc 18954 (src/ 
gen_grammar.pir:228)
called from Sub 'parrot;PCT;HLLCompiler;parse' pc 630 (src/PCT/ 
HLLCompiler.pir:384)
called from Sub 'parrot;PCT;HLLCompiler;compile' pc 433 (src/PCT/ 
HLLCompiler.pir:302)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 834 (src/PCT/ 
HLLCompiler.pir:490)
called from Sub 'parrot;PCT;HLLCompiler;evalfiles' pc 1138 (src/PCT/ 
HLLCompiler.pir:627)
called from Sub 'require' pc 13575 (src/gen_builtins.pir:8446)
called from Sub 'use' pc 13601 (src/gen_builtins.pir:8459)
called from Sub 'anon' pc 8 (EVAL_9:4)
called from Sub 'parrot;Perl6;Grammar;Actions;_block555' pc 104287  
(src/gen_actions.pir:1687)
called from Sub 'parrot;Perl6;Grammar;Actions;use_statement' pc  
104140 (src/gen_actions.pir:1639)
called from Sub 'parrot;Perl6;Grammar;use_statement' pc 43456 (src/ 
gen_grammar.pir:9625)
called from Sub 'parrot;Perl6;Grammar;statement_control' pc 32015  
(src/gen_grammar.pir:5227)
called from Sub 'parrot;Perl6;Grammar;statement' pc 26968 (src/ 
gen_grammar.pir:3386)
called from Sub 'parrot;Perl6;Grammar;statementlist' pc 25021 (src/ 
gen_grammar.pir:2618)
called from Sub 'parrot;Perl6;Grammar;statement_block' pc 23060 (src/