Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyXKV-0006Jb-JE for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Jan 2013 00:39:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TyXKU-0008A5-MQ for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Jan 2013 00:39:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyXKT-0008A0-Vp for pgsql-bugs@postgresql.org; Fri, 25 Jan 2013 00:39:38 +0000 Received: from [2404:130:0:10::40:2] (helo=mail.catalyst.net.nz) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TyXKO-0004K6-CZ for pgsql-bugs@postgresql.org; Fri, 25 Jan 2013 00:39:36 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id A961C32B73; Fri, 25 Jan 2013 13:39:28 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Icn1VD7R-nmF; Fri, 25 Jan 2013 13:39:27 +1300 (NZDT) Received: from [192.168.1.64] (122-60-64-230.jetstream.xtra.co.nz [122.60.64.230]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 78144324DF; Fri, 25 Jan 2013 13:39:27 +1300 (NZDT) Message-ID: <5101D43F.90102@catalyst.net.nz> Date: Fri, 25 Jan 2013 13:39:27 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tom Lane CC: pgsql-bugs@postgresql.org, Joe Conway Subject: Re: PL/R Median Busts Commit (Postgres 9.1.6 + plr 8.3.0.13 on Ubuntu 12.10 64 bit) References: <5100B6B2.8030408@catalyst.net.nz> <51014FCB.30601@joeconway.com> <5101A3DA.5080507@catalyst.net.nz> <5101A47D.6050508@catalyst.net.nz> <25545.1359062304@sss.pgh.pa.us> <5101A7D1.6040703@catalyst.net.nz> <25945.1359063403@sss.pgh.pa.us> <5101B8AF.3090307@catalyst.net.nz> <28888.1359072381@sss.pgh.pa.us> In-Reply-To: <28888.1359072381@sss.pgh.pa.us> Content-Type: multipart/mixed; boundary="------------020703080403000003020800" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2404:130:0:10::40:2 (failed) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------020703080403000003020800 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 25/01/13 13:06, Tom Lane wrote: > Mark Kirkwood writes: >> If I have done this right, then this is the trace for the 1st message... >> from my wandering through the calls here it looks like a normal commit, >> and something goes a bit weird as SI messages are being processed... > > Seems like the critical bit is here: > >> #11 0x00007f4e2a53d985 in exit () from /lib/x86_64-linux-gnu/libc.so.6 >> #12 0x00007f4e272b951a in ?? () from /usr/lib/libR.so >> #13 >> #14 0x00007f4e2a538707 in kill () from /lib/x86_64-linux-gnu/libc.so.6 >> #15 0x00000000006152e5 in SICleanupQueue ( >> callerHasWriteLock=callerHasWriteLock@entry=1 '\001', >> minFree=minFree@entry=4) at sinvaladt.c:672 > > Frame 15 is definitely SICleanupQueue trying to send a catchup SIGUSR1 > interrupt to the furthest-behind backend. The fact that we go directly > into a signal handler from the kill() suggests that the furthest-behind > backend is actually *this* backend, which perhaps is a bit surprising, > but it's supposed to work. What it looks like, though, is that libR has > commandeered the SIGUSR1 signal handler, and just to be extra special > unfriendly to the surrounding program, it does an exit() when it traps a > SIGUSR1. > > Unless libR can be coerced into not screwing up our signal handlers, > I'd say that PL/R is broken beyond repair. That would be unfortunate. > > regards, tom lane It looks like Joe has run into something similar with libR stealing SIGINT, he reinstalls it. A simple patch along the same lines for SIGUSR1 (attached) seems to fix the issue. I wonder if we need to install *all* the remaining signal handlers too? Cheers Mark --------------020703080403000003020800 Content-Type: text/x-patch; name="plr.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="plr.c.diff" *** plr.c.orig 2013-01-25 13:35:15.674086215 +1300 --- plr.c 2013-01-25 13:35:20.770086052 +1300 *************** *** 397,402 **** --- 397,405 ---- */ pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */ + /* Ditto for SIGUSR1*/ + pqsignal(SIGUSR1, procsignal_sigusr1_handler); /* handle usr1 */ + plr_pm_init_done = true; } --------------020703080403000003020800 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --------------020703080403000003020800--