Re: Segment fault when excuting SPI function On PG with commit 41c6a5be

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, "liuhuailing(at)fujitsu(dot)com" <liuhuailing(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
Date: 2021-07-30 15:10:30
Message-ID: 3FC6DA1F-7B24-4B87-8142-10D04F70AB0E@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 30 Jul 2021, at 17:06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I wonder if we should convert the Assert into an actual test-and-elog, say
>
> /* Otherwise, we'd better have an active Portal */
> portal = ActivePortal;
> - Assert(portal != NULL);
> + if (unlikely(portal == NULL))
> + elog(ERROR, "must have an outer snapshot or portal");
> Assert(portal->portalSnapshot == NULL);
>
> Perhaps that would help people to realize that the bug is theirs
> not EnsurePortalSnapshotExists's.

+1, that would probably be quite helpful.

--
Daniel Gustafsson https://vmware.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2021-07-30 15:11:49 Re: [PATCH] test/ssl: rework the sslfiles Makefile target
Previous Message Tom Lane 2021-07-30 15:06:27 Re: Segment fault when excuting SPI function On PG with commit 41c6a5be