With parrot r7902 (compiled with MinGW), ActivePerl 5.8.6 (build 811), on
Win2000.
$ parrot t/op/debuginfo_4.imc
ok 1
ok 2
ok 3
ok 4
ok 5
Null PMC access in invoke()
current instr.: 'd' pc 149 (t/op/debuginfo_4.imc:24)
called from Sub 'c' pc 116 (t/op/debuginfo_4.imc:18)
called from Sub 'b' pc 85 (t/op/debuginfo_4.imc:13)
called from Sub 'a' pc 54 (t/op/debuginfo_4.imc:8)
called from Sub 'main' pc 23 (t/op/debuginfo_4.imc:3)
And it's OK, but
$ perl t/harness t/op/debuginfo.t
# Failed test (t/op/debuginfo.t at line 75)
# 'ok 1
# ok 2
# ok 3
# ok 4
# ok 5
# current instr.: 'd' pc 149
(D:\Documents\DEV\parrot\svn\trunk\t\op\debuginfo_4.imc:24)
# called from Sub 'c' pc 116
(D:\Documents\DEV\parrot\svn\trunk\t\op\debuginfo_4.imc:18)
# called from Sub 'b' pc 85
(D:\Documents\DEV\parrot\svn\trunk\t\op\debuginfo_4.imc:13)
# called from Sub 'a' pc 54
(D:\Documents\DEV\parrot\svn\trunk\t\op\debuginfo_4.imc:8)
# called from Sub 'main' pc 23
(D:\Documents\DEV\parrot\svn\trunk\t\op\debuginfo_4.imc:3)
# Null PMC access in invoke()
# '
# doesn't match '/^ok 1
# ok 2
# ok 3
# ok 4
# ok 5
# Null PMC access in invoke\(\)
# current instr\.: 'd' pc (\d+|-1) \(.*?:(\d+|-1)\)
# called from Sub 'c' pc (\d+|-1) \(.*?:(\d+|-1)\)
# called from Sub 'b' pc (\d+|-1) \(.*?:(\d+|-1)\)
# called from Sub 'a' pc (\d+|-1) \(.*?:(\d+|-1)\)
# called from Sub 'main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
# '
# '.\parrot.exe "D:\Documents\DEV\parrot\svn\trunk\t\op\debuginfo_4.imc"'
failed with exit code 42
The line "Null PMC access in invoke()" jumps at the end after the
backtrace, and it's unexpected.
I try the following patch, but it solves only subtests 4 and 8.
Index: src/exceptions.c
===================================================================
--- exceptions.c (revision 7902)
+++ exceptions.c (working copy)
@@ -53,6 +53,7 @@
va_start(arglist, format);
vfprintf(stderr, format, arglist);
fprintf(stderr, "\n");
+ fflush(stderr);
va_end(arglist);
Parrot_exit(exitcode);
}
For subtests 5-7, the same problem continues with :
Method 'nosuchmethod' not found
Lexical 'nosuchlex' not found
maximum recursion depth exceeded
If somebody has a good idea ...
Francois Perrad
> The line "Null PMC access in invoke()" jumps at the end after the
> backtrace, and it's unexpected.
Ah yep. Mixing stderr/stdout in tests a PITA.
> I try the following patch,
Try to insert these lines:
PIO_flush(interpreter, PIO_STDOUT(interpreter));
PIO_flush(interpreter, PIO_STDERR(interpreter));
which should get the Parrot's stdout/stderr to the console and then ...
> va_start(arglist, format);
> vfprintf(stderr, format, arglist);
> fprintf(stderr, "\n");
> + fflush(stderr);
flush the stderr. This still might reorder the test output, but it should
be consistent: i.e. all output so far should come before the exception
output.
> Francois Perrad
leo
Not possible in the function internal_exception() because 'interpreter' is
not a parameter.
But, I solve the problem in all cases with the following patch in the
beginning of the fonction PDB_backtrace()
Index: src/debug.c
===================================================================
--- src/debug.c (revision 7910)
+++ src/debug.c (working copy)
@@ -2945,6 +2945,8 @@
PMC *old = PMCNULL;
int rec_level = 0;
+ fflush(stderr);
+
/* information about the current sub */
sub = interpinfo_p(interpreter, CURRENT_SUB);
if (!PMC_IS_NULL(sub)) {
Francois.
> Not possible in the function internal_exception() because 'interpreter' is
> not a parameter.
Ah yep. But eventually internal_exception will be replaced by
real_exception for almost all of the cases. You might add a comment WRT
this flushing - and real_exception will very likely need it too.
leo
Francois Perrrad