Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A60C2B5DD91 for ; Fri, 9 Sep 2011 12:13:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 33997-04-5 for ; Fri, 9 Sep 2011 15:13:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mail.postgresql.org (Postfix) with ESMTP id 61E82B5DD87 for ; Fri, 9 Sep 2011 12:13:25 -0300 (ADT) Received: from mail-fx0-f53.google.com ([209.85.161.53]) (using TLSv1) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKTmotFK6WVTDwnKKpTn8EBPHhApsHOA1/@postini.com; Fri, 09 Sep 2011 08:13:25 PDT Received: by mail-fx0-f53.google.com with SMTP id 23so3017316fxd.40 for ; Fri, 09 Sep 2011 08:13:24 -0700 (PDT) Received: by 10.223.6.26 with SMTP id 26mr585895fax.40.1315581203905; Fri, 09 Sep 2011 08:13:23 -0700 (PDT) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id m8sm2980160fae.17.2011.09.09.08.13.21 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Sep 2011 08:13:22 -0700 (PDT) Message-ID: <4E6A2D0F.1050601@enterprisedb.com> Date: Fri, 09 Sep 2011 18:13:19 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 MIME-Version: 1.0 To: Daniel Farina CC: Tom Lane , pgsql-bugs@postgresql.org Subject: Re: BUG #6200: standby bad memory allocations on SELECT References: <201109082233.p88MXbGE026996@wwwmaster.postgresql.org> <11731.1315580564@sss.pgh.pa.us> In-Reply-To: <11731.1315580564@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/60 X-Sequence-Number: 31077 On 09.09.2011 18:02, Tom Lane wrote: > The way that I'd personally proceed to investigate it would probably be > to change the "invalid memory alloc request size" size errors (in > src/backend/utils/mmgr/mcxt.c; there are about four occurrences) from > ERROR to PANIC so that they'll provoke a core dump, and then use gdb > to get a stack trace, which would provide at least a little more > information about what happened. However, if you are only able to > reproduce it in a production server, you might not like that approach. > Perhaps you can set up an extra standby that's only there for testing, > so you don't mind if it crashes? If that's not possible or doesn't reproduce the issue, there's also functions in glibc to produce a backtrace without aborting the program: https://www.gnu.org/s/libc/manual/html_node/Backtraces.html. I think you could also fork() + abort() to generate a core dump, not just a backtrace. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com