[perl #35083] t/op/debuginfo.t fails

1 view
Skip to first unread message

François PERRAD)

unread,
Apr 22, 2005, 6:21:33 AM4/22/05
to bugs-bi...@rt.perl.org
# New Ticket Created by François PERRAD
# Please include the string: [perl #35083]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=35083 >

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


Leopold Toetsch

unread,
Apr 22, 2005, 8:34:01 AM4/22/05
to perl6-i...@perl.org
François" PERRAD <parrotbug...@parrotcode.org> wrote:

> 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

François PERRAD

unread,
Apr 22, 2005, 12:58:00 PM4/22/05
to perl6-i...@perl.org
At 14:34 22/04/2005 +0200, you wrote:
>François" PERRAD <parrotbug...@parrotcode.org> wrote:
>
> > 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));

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.

Leopold Toetsch

unread,
Apr 22, 2005, 1:46:09 PM4/22/05
to François PERRAD, perl6-i...@perl.org
François PERRAD <francoi...@gadz.org> wrote:
> At 14:34 22/04/2005 +0200, you wrote:
>>Try to insert these lines:
>>
>> PIO_flush(interpreter, PIO_STDOUT(interpreter));
>> PIO_flush(interpreter, PIO_STDERR(interpreter));

> 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

François PERRAD

unread,
Apr 26, 2005, 6:22:53 AM4/26/05
to parrotbug...@parrotcode.org

Now, I think my patch is consistent.
internal_exception and real_exception have the same problem, both write in
stderr.
internal_exception directly, real_exception via find_exception_handler.
In both case, I add a fflush(stderr) after fprintf(stderr, ...).

Francois Perrrad

debuginfo.patch
Reply all
Reply to author
Forward
0 new messages