Parrot fails with an optimized build on Win32, Visual C++.  Here are a
few random observations, not sure if they are pointing to the problem or
are merely side effects.

It seems like the failures only affect JIT execution.  I'm only seeing
this with some shootout tests during C<nmake test>, as those are setting
it.  Always using the JIT execution (C<PARROT_ARGS=-j>) makes a whole
lot of other tests fail too.

$ nmake test
...
Failed Test                       Stat Wstat Total Fail  Failed  List of
Failed
-------------------------------------------------------------------------------
t/compilers/imcc/imcpasm/optc.t     40 10240    43   40  93.02%  1-7 11-43
t/compilers/imcc/reg/alloc.t         6  1536    11    6  54.55%  1-2 4-7
t/compilers/imcc/reg/spill.t         6  1536     9    6  66.67%  3 5-9
t/compilers/imcc/syn/bsr.t           2   512    12    2  16.67%  8-9
t/compilers/imcc/syn/const.t         6  1536    34    6  17.65%  1-3 6-7 31
t/compilers/imcc/syn/file.t          5  1280    13    5  38.46%  4 6 8-9 13
t/compilers/imcc/syn/labels.t        1   256     6    1  16.67%  6
... <lots of other failures snipped>
 (1 subtest UNEXPECTEDLY SUCCEEDED), 21 tests and 601 subtests skipped.
Failed 112/307 test scripts, 63.52% okay. 1001/6979 subtests failed,
85.66% okay.

A short program that shows one failure is this.

.sub main :main
    .local pmc stdout
    stdout = getstdout
    print "before say\n"
    stdout.say("Hello World!")
    print "after say\n"
.end

$ parrot test.pir
before say
Hello World!
after say

$ parrot -j test.pir
before say
Hello World!

Parrot segfaults shortly after executing Parrot_callmethodcc_p_sc in
this example, which is F<src/ops/object.ops> C<op callmethodcc(invar
PMC, in STR)>, that is the C<say> method call.

Now, callmethodcc translates into F<src\ops\core_ops.c> and compiling
just this source file without optimization (I know, compiling with
different flags is a thing one should avoid) makes the problem go away,
or at least hide really well.

$ parrot -j test.pir
before say
Hello World!
after say

$ nmake test
...
Failed Test              Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/distro/file_metadata.t    3   768     4    3  75.00%  1-3
t/doc/pod.t                 1   256     1    1 100.00%  1
 (1 subtest UNEXPECTEDLY SUCCEEDED), 21 tests and 601 subtests skipped.
Failed 2/307 test scripts, 99.35% okay. 4/6979 subtests failed, 99.94% okay.


Something similar can be seen with MinGW.  Parrot compiled with C<-Os>.

$ runtests t\examples\shootout.t
...
Test Summary Report
-------------------
t\examples\shootout.t (Wstat: 2048 Tests: 20 Failed: 8)
  Failed tests:  3, 6-10, 17-18
  Tests skipped: 13
  Non-zero exit status: 8
Files=1, Tests=20, 19 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)

F<src\ops\core_ops.c> without C<-Os>.

$ runtests t\examples\shootout.t
...
t\examples\shootout......ok
All tests successful.

Test Summary Report
-------------------
t\examples\shootout.t (Wstat: 0 Tests: 20 Failed: 0)
  Tests skipped: 13
Files=1, Tests=20, 16 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)


Ron

Reply via email to