Re: Segment fault when excuting SPI function On PG with commit 41c6a5be - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
Date
Msg-id 1004237.1627658563@sss.pgh.pa.us
Whole thread Raw
In response to Re: Segment fault when excuting SPI function On PG with commit 41c6a5be  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Segment fault when excuting SPI function On PG with commit 41c6a5be  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
>> On 30 Jul 2021, at 17:06, Tom Lane <tgl@sss.pgh.pa.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.

Happy to make it so.  Anyone have suggestions about the wording of
the message?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PATCH] test/ssl: rework the sslfiles Makefile target
Next
From: Daniel Gustafsson
Date:
Subject: Re: Unbounded %s in sscanf