Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E90A1B5DBC4 for ; Mon, 3 Oct 2011 14:28:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 42412-05 for ; Mon, 3 Oct 2011 17:28:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from joeconway.com (wsip-72-214-29-243.sd.sd.cox.net [72.214.29.243]) by mail.postgresql.org (Postfix) with ESMTP id 2B3BEB5D801 for ; Mon, 3 Oct 2011 14:28:48 -0300 (ADT) Received: from www.joeconway.com (account jconway [192.168.4.40] verified) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 11424113; Mon, 03 Oct 2011 10:28:47 -0700 Message-ID: <4E89F0CF.9080807@joeconway.com> Date: Mon, 03 Oct 2011 10:28:47 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.12) Gecko/20071019 Fedora/1.5.0.12-3.fc6 pango-text Thunderbird/1.5.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Robert Burgholzer CC: "Burgholzer, Robert (DEQ)" , Scott Marlowe , pgsql-admin@postgresql.org Subject: Re: diagnosing a db crash - server exit code 2 References: <4E7CDCA6.6060803@joeconway.com> <4E7CF42E.2050904@joeconway.com> <4E84AB05.1050106@joeconway.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.918 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RDNS_DYNAMIC=0.982 X-Spam-Level: X-Archive-Number: 201110/5 X-Sequence-Number: 38457 On 10/03/2011 10:10 AM, Robert Burgholzer wrote: > FWIW - I am currently trying this while tracing the process that I > assume is the postmaster (/usr/bin/postgres -D /home/postgres/data), > since this process number indicates that it was recently restarted - > although the other PG processes, writer, wal writer, autovacuum, stats > collector all have their older pids indicating that they still survive. Sounds like you are attaching to the wrong process. Try something like the below... Joe Session #1: (connect to db and load PL/R) ----------------- #psql contrib_regression psql (9.2devel) Type "help" for help. contrib_regression=# load '$libdir/plr'; LOAD Session #2: (use ps to find backend and attach) ----------------- # ps -ef |grep postgres postgres 17001 1 0 Sep24 ? 00:00:16 /usr/local/pgsql-head/bin/postgres -D /usr/local/pgsql-head/data -p 55437 -i postgres 17006 17001 0 Sep24 ? 00:02:18 postgres: writer process postgres 17007 17001 0 Sep24 ? 00:01:50 postgres: wal writer process postgres 17008 17001 0 Sep24 ? 00:00:37 postgres: autovacuum launcher process postgres 17009 17001 0 Sep24 ? 00:00:47 postgres: stats collector process postgres 26631 17001 0 10:22 ? 00:00:00 postgres: postgres contrib_regression [local] idle #gdb /usr/local/pgsql-head/bin/postgres 26631 (gdb) continue Continuing. Session #1: (run crashing function) ----------------- run your PL/R function that causes the crash -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support