Subject: kern/22042: New non-socketpair pipe() has SIGIO problems
To: None <gnats-bugs@gnats.netbsd.org>
From: None <tv@pobox.com>
List: netbsd-bugs
Date: 07/03/2003 08:54:03
>Number:         22042
>Category:       kern
>Synopsis:       New non-socketpair pipe() has SIGIO problems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 03 12:55:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Todd Vierling
>Release:        NetBSD 1.6.1_STABLE
>Organization:
	DUH.ORG:  Pointing out the obvious since 1994.
>Environment:
System: NetBSD server.duh.org 1.6.1_STABLE NetBSD 1.6.1_STABLE (HOME) #2: Wed May 21 13:10:29 EDT 2003 tv@server.duh.org:/export/SRC/duh/netbsd-kernels/HOME i386
Architecture: i386
Machine: i386

>Description:

Note that this PR is incomplete, as I don't know the full cause of the
problem at hand.  However, under recommendation of a developer, I'm
submitting this PR now to get the issue tracked.

The FreeBSD port of the JDK has workarounds embedded in it because FreeBSD
has some problems handling SIGIO with pipe(2).  We inherited their pipe(2),
and we apparently have the same or a similar problem exhibited by my JDK
pkgsrc, which I've worked around for now by diverting to socketpair(2).

>How-To-Repeat:

The problem can be reproduced by installing lang/sun-jdk13 (Linux emulation
pipe(2) uses the same sys_pipe() as the native emulation) and attempting to
install www/jakarta-tomcat.  What happens during the jakarta-tomcat
"do-install" is that Ant will reach the following step and then just hang:

    [javadoc] Javadoc execution

javadoc does run and starts reading in source files, but none of its typical
stdout progress messages appear in Ant.  A look at "ps alxw" or "top" shows
that the javadoc process is stuck in "pipewr", and the parent ant-java
process is stuck in "pause".  Both processes periodically wake up on SIGALRM
to do garbage collection, but IO has come to a screeching halt.

Pipes based on socketpair(2) do not exhibit this problem, so I added a
workaround to the jdk1[23] packages that does a direct call to socketpair.
I have not tested on -current yet and cannot verify if sys_pipe() still
exhibits this problem beyond the 1.6 branch.

>Fix:

Unknown at this time.
>Release-Note:
>Audit-Trail:
>Unformatted: