Subject: kern/14246: NEW_PIPE bug when reading and writing from the same process
To: None <gnats-bugs@gnats.netbsd.org>
From: Andreas Persson <pap.is@home.se>
List: netbsd-bugs
Date: 10/15/2001 02:10:49
>Number:         14246
>Category:       kern
>Synopsis:       NEW_PIPE bug when reading and writing from the same process
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 14 17:12:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Persson
>Release:        NetBSD-current
>Organization:
>Environment:
System: NetBSD sisyfos.peripatetic 1.5Y NetBSD 1.5Y (SISYFOS) #3: Mon Oct 15 00:29:50 CEST 2001 ap@sisyfos.peripatetic:/usr/src/sys/arch/i386/compile/SISYFOS i386
Architecture: i386
Machine: i386
>Description:
When a pipe is used in a blocking state to pass data back and forth to the
same process and the size is >= PIPE_MINDIRECT, the process will sleep
indefinetly with wait channel pipdwt. Worse, when the pipe is non-blocking,
it will still sleep after a few writes (the number varies), though I don't
see how this could happen from reading the code. This may be related to PR
kern/14196.

>How-To-Repeat:
Download and compile:
http://www-106.ibm.com/developerworks/linux/library/l-rt4/pipespeed2.cpp
See also:
http://www-106.ibm.com/developerworks/linux/library/l-rt4/?t=gr,p=Pipes

>Fix:
I don't see why we have to sleep in the first place. Shouldn't uvm_loan handle
protecting the shared pages?
>Release-Note:
>Audit-Trail:
>Unformatted: