[Top][All Lists]

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

pipe test case in perl - problem found

From: Marcus Brinkmann
Subject: pipe test case in perl - problem found
Date: Thu, 2 May 2002 18:50:22 -0400
User-agent: Mutt/1.3.25i


the perl test which tests if writing to a broken pipe fails properly
doesn't fail, as reported before.  Under rpctrace, it did.  Here the
main code:

  signal (SIGPIPE, foo);
  pipe (fds);
  close (fds[0]);
  /* sleep (1); */
  err = write (fds[1], "hallo", 6);

I think the reason might be that the write happens before the dead
name notification for the other end of the pipe is processed!

I have not verified this by monitoring what pflocal does, but this is
the only reasonable explanation.  The write() above succeeds.  When
I add a pause just before that (the sleep() above), the program works
correctly, but raising the pipe signal.

This is because close() is asynchronous on the Hurd.  This was also
an issue for SO_LINGER, might be an issue for record locking (depends
on how we will implement it, I guess), and was also an issue for one
other case where we need an error value from the server (I forgot what
it was, Roland mentioned that in his reply to my SO_LINGER analysis).

I am not sure if this particular test case is required to have the
expected result under POSIX.  But even if not, I think we need to
tart to think about some synchronization with fileystem servers
at close().  For example, couldn't we move the send
right back to the filesystem server in close?  The server could check
deallocate it and check if it was the last one, and act accordingly
(for record locks, it would not check, but just remove all locks for
this file, again depending on how we implement that).
Maybe something like that, I haven't thought it through yet.


reply via email to

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