From marka@isc.org  Wed Dec 12 21:15:58 2007
Return-Path: <marka@isc.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DE49916A418
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Dec 2007 21:15:58 +0000 (UTC)
	(envelope-from marka@isc.org)
Received: from drugs.dv.isc.org (drugs.dv.isc.org [IPv6:2001:470:1f00:820:214:22ff:fed9:fbdc])
	by mx1.freebsd.org (Postfix) with ESMTP id A5A4F13C455
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Dec 2007 21:15:58 +0000 (UTC)
	(envelope-from marka@isc.org)
Received: from drugs.dv.isc.org (localhost [127.0.0.1])
	by drugs.dv.isc.org (8.14.2/8.14.1) with ESMTP id lBCLFvAr088527
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Dec 2007 08:15:57 +1100 (EST)
	(envelope-from marka@drugs.dv.isc.org)
Received: (from marka@localhost)
	by drugs.dv.isc.org (8.14.2/8.14.1/Submit) id lBCLFvww088526;
	Thu, 13 Dec 2007 08:15:57 +1100 (EST)
	(envelope-from marka)
Message-Id: <200712122115.lBCLFvww088526@drugs.dv.isc.org>
Date: Thu, 13 Dec 2007 08:15:57 +1100 (EST)
From: Mark Andrews <marka@isc.org>
Reply-To: Mark Andrews <marka@isc.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Bad interaction between SIGPIPE and threads.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         118626
>Category:       kern
>Synopsis:       Bad interaction between SIGPIPE and threads.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 12 21:20:01 UTC 2007
>Closed-Date:    Mon Jan 14 08:00:00 UTC 2008
>Last-Modified:  Wed Jul  2 02:40:03 UTC 2008
>Originator:     Mark Andrews
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
ISC
>Environment:
System: FreeBSD drugs.dv.isc.org 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #18: Mon Dec 10 14:45:13 EST 2007 marka@drugs.dv.isc.org:/usr/obj/usr/src/sys/DRUGS i386


>Description:

	SIGPIPE is a crude mechanism and we really should have a
	way to turn this on and off on a per file descriptor basis
	especially in threaded applications where you can't just
	ignore the signal for specific writes like you would for
	a unthreaded application.

	The resolver library, and I presume other sockets based
	libraries, need to be able to disable SIGPIPE for specific
	writes yet still have the application fail when writes to
	stdout fail because the application has not caught SIGPIPE.

>How-To-Repeat:

>Fix:



>Release-Note:
>Audit-Trail:

From: David Schultz <das@FreeBSD.ORG>
To: Mark Andrews <marka@isc.org>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/118626: Bad interaction between SIGPIPE and threads.
Date: Wed, 12 Dec 2007 17:20:09 -0500

 Have you tried the SO_NOSIGPIPE option to setsockopt()?
 It's designed for exactly the sort of thing you describe,
 although I'm given to believe that it only works with
 send*() and not write().

From: Mark Andrews <Mark_Andrews@isc.org>
To: bug-followup@FreeBSD.org, marka@isc.org
Cc:  
Subject: Re: kern/118626: Bad interaction between SIGPIPE and threads.
Date: Thu, 13 Dec 2007 11:41:16 +1100

 I'll definitely try it.
 
 The man page for socket(2) should be updated to reference SO_NOSIGPIPE
 where it talks about SIGPIPE being generated.
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Mon Jan 14 06:44:47 UTC 2008 
State-Changed-Why:  
To submitter: did the suggestion fix the problem? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118626 
State-Changed-From-To: feedback->closed 
State-Changed-By: remko 
State-Changed-When: Mon Jan 14 07:59:59 UTC 2008 
State-Changed-Why:  
submitter replies that this had been resolved 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118626 

From: linimon@lonesome.com (Mark Linimon)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/118626: Bad interaction between SIGPIPE and threads.
Date: Tue, 1 Jul 2008 21:39:17 -0500

 ----- Forwarded message from David Schultz <das@FreeBSD.ORG> -----
 
 From: David Schultz <das@FreeBSD.ORG>
 To: Mark Andrews <Mark_Andrews@isc.org>, freebsd-bugs@FreeBSD.ORG
 
 On Fri, Dec 14, 2007, Mark Andrews wrote:
 > It's documented in setsockopt(2).  It just also needs to be documented
 > in socket(2).
 
 I added a note to the socket(2) manpage. Better late than never.
 
 ----- End forwarded message -----
>Unformatted:
