Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9FC8C6329C3 for ; Fri, 17 Jul 2009 13:18:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 52210-01 for ; Fri, 17 Jul 2009 13:18:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id BA0EB6329B2 for ; Fri, 17 Jul 2009 13:18:02 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n6HGHuBs002760; Fri, 17 Jul 2009 12:17:56 -0400 (EDT) To: Frank van Vugt cc: pgsql-bugs@postgresql.org Subject: Re: bug or simply not enough stack space? In-reply-to: <200907171110.58371.ftm.van.vugt@foxi.nl> References: <200907161545.20338.ftm.van.vugt@foxi.nl> <200907161630.29119.ftm.van.vugt@foxi.nl> <9169.1247755019@sss.pgh.pa.us> <200907171110.58371.ftm.van.vugt@foxi.nl> Comments: In-reply-to Frank van Vugt message dated "Fri, 17 Jul 2009 11:10:57 +0200" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <2742.1247847429.0@sss.pgh.pa.us> Date: Fri, 17 Jul 2009 12:17:56 -0400 Message-ID: <2759.1247847476@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/231 X-Sequence-Number: 23693 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2742.1247847429.1@sss.pgh.pa.us> Frank van Vugt writes: > So this took a while, but here's your test case..... > Turns out to be quite small actually ;) Hmm ... the relevant code change seems to have been http://archives.postgresql.org/pgsql-committers/2009-04/msg00127.php I think I might have been overenthusiastic in trying to free resources during a subtransaction abort. Try this patch and see if you notice any bad side-effects. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2742.1247847429.2@sss.pgh.pa.us> Content-Description: subxact-abort.patch Index: src/pl/plpgsql/src/pl_exec.c =================================================================== RCS file: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v retrieving revision 1.244 diff -c -r1.244 pl_exec.c *** src/pl/plpgsql/src/pl_exec.c 17 Jun 2009 13:46:12 -0000 1.244 --- src/pl/plpgsql/src/pl_exec.c 17 Jul 2009 16:12:22 -0000 *************** *** 5292,5298 **** { SimpleEcontextStackEntry *next; ! FreeExprContext(simple_econtext_stack->stack_econtext); next = simple_econtext_stack->next; pfree(simple_econtext_stack); simple_econtext_stack = next; --- 5292,5299 ---- { SimpleEcontextStackEntry *next; ! if (event == SUBXACT_EVENT_COMMIT_SUB) ! FreeExprContext(simple_econtext_stack->stack_econtext); next = simple_econtext_stack->next; pfree(simple_econtext_stack); simple_econtext_stack = next; ------- =_aaaaaaaaaa0--