On Tue, Jan 04, 2011 at 11:14:43AM -0000, Parrot wrote:
> #1932: rakudo on parrot RELEASE_2_11_0-656-g27c0799 executes main body twice
> {{{
> $ ./perl6 -e 'say 3'
> 3
> 3
> }}}
>
> likewise all test files confuse the test harness.
>
> This didn't happen on RELEASE_2_11_0-478-gd69dbbc for example, and in the
> mean time rakudo didn't change signficantly.
NQP-rx exhibits a similar (same?) problem with RELEASE_2_11_0-663-g7cc276c --
many tests end up running twice and confusing the test harness.
It appears to be the same set of tests that were suffering from the
implicit :main issues discussed in TT #1704, so I suggest that's a likely
starting point for tracking down this problem.
Pm

Here we can see that the :load sub is being invoked even when not loaded via load_bytecode.

NQP and Rakudo have to generate :load subs at the end of each module to automatically invoke the module's mainline when the module is loaded via load_bytecode. Since :load subs are now being invoked even for the initial program file or when compiled in memory (which is the province of the :init flag), the mainline gets executed "twice".