Re: Recovering from an exception

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: Recovering from an exception
Дата
Msg-id op.wp9cc9qxye4vw9@blue.lan
обсуждение исходный текст
Ответ на Recovering from an exception  (Marko Tiikkaja <pgmail@joh.to>)
Ответы Re: Recovering from an exception
Список pgsql-general
Hi,

On Tue, 01 Jan 2013 15:56:50 +0100, I wrote:
> It looks like fcinfo (amongst other things) is allocated in a child of
> the SPI context.  My speculation is that the SPI context gets reset by
> AtEOSubXact_SPI(), thus resetting the memory fcinfo points to, leading
> to SIGSEGV.

Indeed, that looks to be the case.  If I change the bottom part of
AtEOSubXact_SPI() a bit:

-       if (_SPI_current && !isCommit)
+       if (_SPI_current && _SPI_current->connectSubid == mySubid &&
!isCommit)

the problem goes away.

I'm puzzled as to why AtEOSubXact_SPI() needs to unconditionally clear the
surround SPI context, or why it assumes it's a good idea.



Regards,
Marko Tiikkaja


В списке pgsql-general по дате отправления:

Предыдущее
От: Rafał Pietrak
Дата:
Сообщение: Re: OLD pseudo relation for INSERT in rules and triggers
Следующее
От: "Marko Tiikkaja"
Дата:
Сообщение: Re: Recovering from an exception