Re: Segment fault when excuting SPI function On PG with commit 41c6a5be
Daniel Gustafsson <daniel@yesql.se>
From: Daniel Gustafsson <daniel@yesql.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>,
"liuhuailing@fujitsu.com" <liuhuailing@fujitsu.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-07-30T15:10:30Z
Lists: pgsql-hackers
> 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. -- Daniel Gustafsson https://vmware.com/
Commits
-
Use elog, not Assert, to report failure to provide an outer snapshot.
- f260436459a6 12.8 landed
- ef12f32c0870 15.0 landed
- ec410c985e6d 14.0 landed
- cefb1230e7aa 11.13 landed
- 93f99693f9c2 13.4 landed
-
Restore the portal-level snapshot after procedure COMMIT/ROLLBACK.
- 41c6a5bec25e 12.8 cited