Re: Re[2]: [BUGS] Segfault in MemoryContextAlloc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Dmitriy Sarafannikov <dimon99901(at)mail(dot)ru>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Re[2]: [BUGS] Segfault in MemoryContextAlloc
Date: 2016-02-06 23:30:20
Message-ID: 31289.1454801420@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2016-01-27 13:26 GMT+01:00 Andres Freund <andres(at)anarazel(dot)de>:
>> What exactly does your extension do? And where did you add that null check?

> this extension does some log preprocessing for syslog
> extension and fix attached

That extension is broken on its face. You cannot have an emit_log_hook
that does catalog access, because elog() can be called outside a
transaction or in an already-failed transaction. Whatever band-aids
you put around that will just be band-aids that will fail regularly.
You need to move the catalog lookup someplace else. (Actually, I wonder
why you're doing a catalog lookup at all ... wouldn't it be sufficient to
do a DirectFunctionCall to inet_out?)

I doubt this has much to do with the OP's issue.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-02-06 23:37:58 Re: Re[2]: [BUGS] Segfault in MemoryContextAlloc
Previous Message Peter J. Holzer 2016-02-06 18:10:08 Re: BUG #13898: ecpg complains on nested comments in /usr/pgsql-9.4/include/informix/esql/datetime.h