bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#755295: Hurd term server (was: Hurd GCC ping)


From: Samuel Thibault
Subject: Re: Bug#755295: Hurd term server (was: Hurd GCC ping)
Date: Sun, 18 Jan 2015 22:03:49 +0100
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Hello,

Trying a bit on Linux with buffer sizes, this really is an issue between
tcl and expect. It happens to work on Linux only by luck because Linux
never returns more than 4095 bytes on ptys.  As you described earlier,
what happens is:

- expect has a 6001 bytes buffer
- tcl will read() by 4096 bunches

on Linux, the tcl read() will always get a 4095 bytes short read, and
thus provide the bytes to expect.

on Hurd, the tcl read() will get a 4096 full read, and thus tcl will
try to fill more, and eventually get an EIO error because the writer is
away.

I've rebuilt tcl and expect with the attached patches, to lower the
buffer size and thus avoid the short reads on Linux.

With the attached test and e files, I get this:

read(6, "/media/erich/home/thomas/tmp/gcc"..., 1024) = 1024
read(6, "oating constant\r\n/media/erich/ho"..., 1024) = 1024
read(6, "valid suffix \"rul\" on floating c"..., 1024) = 1024
write(1, "/media/erich/home/thomas/tmp/gcc"..., 1024) = 1024
write(1, "oating constant\r\n/media/erich/ho"..., 1024) = 1024
write(1, "valid suffix \"rul\" on floating c"..., 953) = 953
write(4, "\0", 1)                       = 1
...
read(6, "p/pr33466.c:31:19: error: invali"..., 1024) = 1024
read(6, "/gcc/testsuite/gcc.dg/cpp/pr3346"..., 1024) = 1024
read(6, "ch/home/thomas/tmp/gcc/trunk/gcc"..., 1024) = 1024
write(1, "onstant\r\n/media/erich/home/thoma"..., 1024) = 1024
write(1, "ffix \"lku\" on floating constant\r"..., 1024) = 1024
write(1, "66.c:46:18: error: invalid suffi"..., 953) = 953
write(4, "\0", 1)                       = 1
...
read(6, " constant\r\n/media/erich/home/tho"..., 1024) = 1024
read(6, "ix \"fdd\" on floating constant\r\n/"..., 1024) = 1024
read(6, 0xdd6568, 1024)                 = -1 EIO (Input/output error)

and the output is truncated to only the 2 first series of writes!

I guess the fix should be in tcl, to store the error, and provide it to
expect only after having returned the remaining bytes.

Samuel

Attachment: patch
Description: Text document

Attachment: patch2
Description: Text document

Attachment: e
Description: Text document

Attachment: test
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]