Re: bug or simply not enough stack space? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: bug or simply not enough stack space?
Date
Msg-id 2759.1247847476@sss.pgh.pa.us
Whole thread Raw
In response to Re: bug or simply not enough stack space?  (Frank van Vugt <ftm.van.vugt@foxi.nl>)
Responses Re: bug or simply not enough stack space?
List pgsql-bugs
Frank van Vugt <ftm.van.vugt@foxi.nl> 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

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;

pgsql-bugs by date:

Previous
From: Greg Stark
Date:
Subject: Re: Huge speed penalty using <>TRUE instead of =FALSE
Next
From: Tom Lane
Date:
Subject: Re: BUG #4926: too few pathkeys for mergeclauses