[Top][All Lists]

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

tclsh issue (was: shutdown)

From: olafBuddenhagen
Subject: tclsh issue (was: shutdown)
Date: Sun, 10 Feb 2008 00:47:42 +0100
User-agent: Mutt/1.5.17 (2007-11-01)


(CCing to bug-hurd, as this is the right list for such things.)

On Tue, Feb 05, 2008 at 11:56:50AM -0500, Abrahm Scully wrote:

> What would cause
> echo 'puts [info tclversion]' | /usr/bin/tclsh8.4 -
> to print 8.4, but
> echo `echo 'puts [info tclversion]' | /usr/bin/tclsh8.4 -`
> to hang indefinitely?

The problem is with the output of tclsh being redirected through a pipe
-- you can also reproduce it with:

   echo 'puts [info tclversion]' | /usr/bin/tclsh8.4 - | cat

This will print the version number, and hang afterwards. (But you can
abort the hang with ^C in this case, as it's only cat hanging, not the

This seems to be a bug in the pflocal server, which is responsible for
pipes (socket pairs). When the writing process closes the pipe, pflocal
gets a notification, and normally will make the read() RPC from the
receiving process return EOF; but when tclsh is the writer, for some
reason it doesn't do that -- the read() hangs forever. I have no ideas
what tclsh does that makes it behave different from other programs.

I tried finding the bug with a combination of rpctrace and gdb on
pflocal (unfortunately, both at the same time doesn't work very
well...), as well as code staring at the pipe() implementation in glibc
and at pflocal. While this was a good learning experience in Hurd
debugging, I didn't get much further with finding the bug. Later I got
distracted with other things. No idea when I will be able to get back to
this; maybe someone can beat me to it.


reply via email to

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