Re: Fwd: Core dump with nested CREATE TEMP TABLE
От | Michael Paquier |
---|---|
Тема | Re: Fwd: Core dump with nested CREATE TEMP TABLE |
Дата | |
Msg-id | CAB7nPqSjGHihB6jA95mGapepHYdd5Ywa-qn3qnBGi0ktvhuKDA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Fwd: Core dump with nested CREATE TEMP TABLE (Michael Paquier <michael.paquier@gmail.com>) |
Ответы |
Re: Fwd: Core dump with nested CREATE TEMP TABLE
|
Список | pgsql-hackers |
On Wed, Sep 2, 2015 at 6:21 AM, Michael Paquier wrote: > Yes, that's what I have been looking at actually by having some markers in relcache.c. The reference count of this relationget incremented here: So, I have been playing more with this code, and as mentioned by Andres this test case goes twice through the PG_CATCH block in pl_exec.c, causing the crash as the temporary relation does not get dereferenced. I may be missing something, but isn't it a matter of moving the switch to the old memory context at the end of the block so as we can get a correct cleanup of the estate in the first block? See for example the attached that fixes the problem for me, and passes make checkworld, though I expect Tom and Andres to jump in and say that this is not correct within the next 12 hours :) I haven't written yet a test case but I think that we could reproduce that simply by having a relation referenced in the exception block of a first function, calling a second function that itself raises an exception, causing the referencing error. Regards, -- Michael
Вложения
В списке pgsql-hackers по дате отправления: