Bug#848408: libapp-termcast-perl: FTBFS randomly (failing tests)
Niko Tyni
ntyni at debian.org
Mon Jan 2 10:18:31 UTC 2017
On Wed, Dec 28, 2016 at 11:31:51PM +0200, Niko Tyni wrote:
> > and it looks like the race is between this process exiting and its parent
> > (IO::Pty::Easy) having enough time to read the last echoed newline.
> >
> > Unfortunately it goes away with 'strace -f', so I don't have the full
> > analysis, but the attached script reliably fixes it for me.
I since managed to get strace output as well. What happens is that
after the child process has closed its pty slave file handle (exiting
or otherwise), the parent gets EIO (Input/output error) on reading the
master side. Normally the terminal echo newline gets buffered first and
can be read out, but sometimes even that gets lost. I suppose this could
be considered a kernel issue; I don't see anything user space could do
about it.
For Debian, I suggest we either insert 'sleep 1' calls in the 'last if
/^$/' constructs as a workaround, or mark those tests as TODO.
Jesse, do you want a github / RT bug about this ?
FWIW I was able to trigger this running the attached script in a loop
in a uniprocessor VM on a loaded host. Excerpt from the strace log
below. FD 8 is the synchronization pipe, FD 3 is the pty master
and FD 4 is the pty slave.
19437 close(8) = 0
19437 close(4) = 0
19437 read(5, <unfinished ...>
19438 set_robust_list(0x7fe1b00415a0, 24) = 0
19438 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
19438 close(8 <unfinished ...>
19437 <... read resumed> "", 8192) = 0
19437 write(3, "\n", 1) = 1
19437 read(3, <unfinished ...>
19438 <... close resumed> ) = 0
19438 close(4 <unfinished ...>
19437 <... read resumed> 0x7fe1b165d470, 8192) = -1 EIO (Input/output error)
--
Niko Tyni ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pty.pl
Type: text/x-perl
Size: 541 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20170102/8616b8fe/attachment-0002.pl>
More information about the pkg-perl-maintainers
mailing list