Re: BUG #17126: Server crashes on dropping user while enumerating owned objects that are droppped concurrently
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2021-07-28T20:01:01Z
Lists: pgsql-bugs
Attachments
- null-objdesc.patch (text/x-diff) patch
On 2021-Jul-28, PG Bug reporting form wrote: > Dropping a user that owns a number of procedures, while some of them are > being dropped, can cause the server crash: > > Core was generated by `postgres: law regression [local] DROP ROLE > '. > Program terminated with signal SIGABRT, Aborted. > #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 > 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. > (gdb) bt > #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 > #1 0x00007f268882b859 in __GI_abort () at abort.c:79 > #2 0x000055a23a628276 in ExceptionalCondition (conditionName=conditionName@entry=0x55a23a77fd4d "pointer != NULL", > errorType=errorType@entry=0x55a23a68700b "FailedAssertion", fileName=0x7ffdf4459470 "W\202b:\242U", > fileName@entry=0x55a23a7886b0 "../../../../src/include/utils/memutils.h", lineNumber=lineNumber@entry=123) > at assert.c:69 > #3 0x000055a23a65b46e in GetMemoryChunkContext (pointer=0x0) at ../../../../src/include/utils/memutils.h:123 > #4 pfree (pointer=pointer@entry=0x0) at mcxt.c:1171 > #5 0x000055a23a23254f in storeObjectDescription (descs=descs@entry=0x7ffdf44598b0, type=LOCAL_OBJECT, > object=object@entry=0x55a23b5efe10, deptype=SHARED_DEPENDENCY_OWNER, count=count@entry=0) at pg_shdepend.c:1267 There's many places that deal correctly with the possibility that getObjectDescription() would return NULL, but I found two places that don't. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Commits
-
Avoid crash in rare case of concurrent DROP
- e0eaeafd6646 9.6.24 landed
- d74b54b3ddf7 15.0 landed
- 02e20bb2dcaa 14.1 landed
- bf5cdcfd5e44 13.5 landed
- 92224e470c83 11.14 landed
- 58b600f64bfb 10.19 landed
- 3eff168a29ca 12.9 landed