Truncated compiler output in remote.exp's local_exec

From:

Dan Kegel

Subject:

Truncated compiler output in remote.exp's local_exec

Date:

Sat, 19 Jul 2003 13:14:06 -0700

Remember http://gcc.gnu.org/ml/gcc/2001-02/msg01313.html ? It's baaack!
In that message, Joseph S. Myers wrote:
> Any chance you could investigate the intermittent problems some people see
> with spurious failures in gcc.dg/format apparently associated with
> truncation of output? For example, with tcl 8.3.2, expect 5.32.1 and
> dejagnu 1.4, I saw a bogus failure on gcc.dg/format/c90-scanf-1.c, with
> the log file showing
>
> /home/jsm28/src/gcc-3cvs/gcc/testsuite/gcc.dg/format/c90-scanf-1.c:117:
warning: spurious trailing `%' in formoutput is:
>
> (i.e., truncated in the middle of a line of output, near the end of the
> compiler's diagnostic output, after "form" which should be part of the
> word "format").
I'm seeing the same thing today. I can reproduce it with the command
DEJAGNU=$TOP/boards/master.exp runtest --tool=gcc --target=$TARGET -v -v -v
-a dg.exp=typespec-1.c
(Problem also happens without the -v's.)
Immediately following the truncated output (which ends without a newline),
without an intervening newline, I see "waitres is 10409 exp6 0 1"
This is printed in remote.exp's local_exec.
The problem inexplicably goes away if I insert a 'verbose' statement
(see following patch), but only if I run with -v -v -v or higher;
without three -v's, the truncation still happens.
(Incidentally, that limit of 512000 will probably cause real problems soon,
as this test legitimately outputs around 300KB of text, but I guess
that's a different bug lurking.
We ought to up that limit to a megabyte to be a bit safer, or
put in an explicit abort if we overrun that size instead of silently
truncating.)
--- dejagnu-1.4.3/lib/remote.exp.old Sat Jul 19 13:04:33 2003
+++ dejagnu-1.4.3/lib/remote.exp Sat Jul 19 13:04:45 2003
@@ -160,6 +160,7 @@
# exit.
expect {
-i $spawn_id -timeout $timeout -re ".+" {
+ verbose "kludge: if running with runtest -v -v -v, this
statement inexplicably rescues output that otherwise gets truncated";
append output $expect_out(buffer);
if { [string length $output] < 512000 } {
exp_continue -continue_timer;
Perhaps someone who knows the code better than me can dig into this?
Expect version is 5.32.2
Tcl version is 8.3
Framework version is 1.4.3
OS is Debian 3.0.
Thanks,
Dan