X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 8E72111F6773 for ; Mon, 24 Apr 2006 15:08:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 50616-02-7 for ; Mon, 24 Apr 2006 15:08:08 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id A8AB411F6C82 for ; Mon, 24 Apr 2006 14:39:42 -0300 (ADT) Received: from candle.pha.pa.us (candle.pha.pa.us [70.90.9.53]) by svr4.postgresql.org (Postfix) with ESMTP id C9FD35B071D for ; Mon, 24 Apr 2006 17:14:16 +0000 (GMT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id k3OHEBA10763; Mon, 24 Apr 2006 13:14:11 -0400 (EDT) From: Bruce Momjian Message-Id: <200604241714.k3OHEBA10763@candle.pha.pa.us> Subject: Re: Receiving SIGPIPE for PQfinish() In-Reply-To: <20060424101705.GB259@alamut> To: Volkan YAZICI Date: Mon, 24 Apr 2006 13:14:11 -0400 (EDT) Cc: Tom Lane , pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/26 X-Sequence-Number: 6117 Volkan YAZICI wrote: > On Apr 23 12:09, Bruce Momjian wrote: > > Did you ever get this fixed? > > Actually, I couldn't reproduce same error on my current system - > although, as I understand, none of the related source files were > modified. (That failure was reported using Debian Sarge 3.1, so > it could be caused by buggy debian libraries - like their buggy > getpw..._r() family.) > > > Volkan YAZICI wrote: > > > On Mar 12 11:18, Tom Lane wrote: > > > > pqsecure_write should have disabled SIGPIPE already. You should look > > > > into why that is seemingly not working. > > > > > > When I omit --enable-thread-safety, code doesn't handle in the case of > > > a SIG_ERR return on the call to pqsignal() made from pqsecure_write(). > > > > > > Furthermore, I still couldn't figure out why pqsignal() cannot handle > > > SIGPIPE - despite pqsignal() doesn't return SIG_ERR. (A related small > > > debug output is attached.) > > I don't have much experience with signal handling but if any hacker will > ever get chance to take a look at SIG_ERR returning pqsignal() calls' > handling, above problem (?) will be clarified. > > > > Everything works fine when thread safety is enabled. > > What are the reasons for thread-safety is not enabled by default? Is > this because related system may not support thread locking to be used in > libpq? Good question. One issue is that not all operating systems will pass the regession configure tests, so we could only support threading on some platforms by default. If we get enough OS support, we can then support it by default, and have a flag to disable it, like we do with readline handling. -- Bruce Momjian http://candle.pha.pa.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +