Re: segfault in HEAD when too many nested functions call

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: segfault in HEAD when too many nested functions call
Date: 2017-07-26 01:26:41
Message-ID: 20170726012641.bmhfcp5ajpudihl6@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2017-07-24 13:27:58 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> >> * I think the comments need more work. Am willing to make a pass over
> >> that if you want.
>
> > That'd be good, but let's wait till we have something more final.
>
> Agreed, I'll wait till you produce another version.

Attached. Did a bunch of cleanup myself already.

I've moved the CHECK_FOR_INTERRUPTS() to the callsites. That
unsurprisingly ends up being somewhat verbose, and there's a bunch of
minor judgement calls where exactly to place them. While doing so I've
also added a few extra ones. Did this in a separate patch to make it
easier to review.

I'm pretty jetlagged right now, so I want to do another pass to make
sure I didn't forget any CFI()s, but the general shape looks right.

Tried to address the rest of your feedback too.

> >> * Can we redefine the ExecCustomScan function pointer as type
> >> ExecProcNodeCB, eliminating the unsightly cast in nodeCustom.c?
>
> > That'd change an "extension API", which is why I skipped it at this
> > point of the release cycle. It's not like we didn't have this type of
> > cast all over before. Ok, with changing it, but that's where I came
> > down.
>
> Is this patch really not changing anything else that a custom-scan
> extension would touch? If not, I'm okay with postponing this bit
> of cleanup to v11.

FWIW, I've reintroduced ExecCustomScan() which I'd previously removed,
because it now contains a CHECK_FOR_INTERRUPTS(). So this seems moot.

Greetings,

Andres Freund

Attachment Content-Type Size
0001-Move-interrupt-checking-from-ExecProcNode-to-callers.patch text/x-patch 22.4 KB
0002-Move-ExecProcNode-from-dispatch-to-function-pointer-.patch text/x-patch 67.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2017-07-26 01:54:24 Re: [PATCH] Make ExplainBeginGroup()/ExplainEndGroup() public.
Previous Message Thomas Munro 2017-07-26 01:21:26 Log LDAP "diagnostic messages"?