Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 980F6227498 for ; Tue, 20 Dec 2011 19:56:32 -0400 (AST) Received: from mail-gy0-f174.google.com ([209.85.160.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rd9Xp-0001u6-0k for pgsql-bugs@postgresql.org; Tue, 20 Dec 2011 23:56:33 +0000 Received: by ghbz12 with SMTP id z12so4521064ghb.19 for ; Tue, 20 Dec 2011 15:56:16 -0800 (PST) Received: by 10.236.161.133 with SMTP id w5mr7092739yhk.63.1324425375967; Tue, 20 Dec 2011 15:56:15 -0800 (PST) Received: from [10.1.1.6] ([124.150.53.33]) by mx.google.com with ESMTPS id y17sm9582560anc.2.2011.12.20.15.56.11 (version=SSLv3 cipher=OTHER); Tue, 20 Dec 2011 15:56:14 -0800 (PST) Message-ID: <4EF12097.5060907@ringerc.id.au> Date: Wed, 21 Dec 2011 07:56:07 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: Tom Lane CC: Andrea Grassi , harrywr2@comcast.net, 'Pg Bugs' , 'Alvaro Herrera' Subject: Re: R: R: R: R: BUG #6342: libpq blocks forever in "poll" function References: <4EEB0006.7080205@ringerc.id.au> <001201ccbbfc$82c987a0$885c96e0$@com> <4EEC3462.80702@ringerc.id.au> <000601ccbef6$060820d0$12186270$@com> <1324395708-sup-4443@alvh.no-ip.org> <001701ccbf34$72480970$56d81c50$@com> <20092.1324399103@sss.pgh.pa.us> <002301ccbf3c$cc34b110$649e1330$@com> <6410.1324402946@sss.pgh.pa.us> In-Reply-To: <6410.1324402946@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.2 (-) X-Archive-Number: 201112/182 X-Sequence-Number: 31993 On 21/12/2011 1:42 AM, Tom Lane wrote: > Hrm. What's with the 48 bytes in the client's receive queue? Surely > the kernel should be reporting that the socket is read-ready, if it's > got some data. I think you've found an obscure kernel bug ---- somehow > it's failing to wake the poll() caller. > I've been leaning that way too; that's why I was asking him for /proc/$pid/stack and `wchan -C programname -o wchan:80=` output - to get some idea of what function in the kernel it's sitting in. Unfortunately the OP is on some enterprise distro that doesn't have /proc/$pid/stack . wchan info would still be useful. I wonder how old their kernel is? The bug could've already been fixed. /proc/pid/stack has been around since 2008 so it must be pretty elderly. OP: You can also get a kernel stack for a process by enabling the magic SysRQ key (see Google) then using Alt-SysRq-T . This requires a physical keyboard directly connected to the server. It emits the stack information via dmesg. See: http://en.wikipedia.org/wiki/Magic_SysRq_key There's a "sysrqd" that apparently lets you use these features remotely, but I've never tried it. -- Craig Ringer