Re: BUG #19382: Server crash at __nss_database_lookup

From: surya poondla <suryapoondla4(at)gmail(dot)com>
To: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Cc: songjinzhou <tsinghualucky912(at)foxmail(dot)com>, dllggyx <dllggyx(at)outlook(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Subject: Re: BUG #19382: Server crash at __nss_database_lookup
Date: 2026-07-07 23:20:55
Message-ID: CAOVWO5pjSeYh1UOGaROXr51GhAf9QsLXJeqp__-D4BtHs5oESA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Zsolt,

Thanks for the testing, both issues you reported were real; v10 (attached)
fixes them.

Case 1 (plain "record" still crashed): the snapshot keyed off the
variable's declared type, which is just RECORDOID for a RECORD variable, so
nothing was tracked.
v10 uses the actual composite type adopted from the assigned value
(er_typeid), so "r record := ROW(...)::foo" is now covered.

Case 2 (reassignment wrongly rejected): a fast path only re-checked the
outermost type, so a stale nested entry survived a reassignment and caused
a false positive.
v10 refreshes the snapshot on every whole-record assignment, so reassigning
with fresh data after an ALTER now succeeds (matching master), while the
same sequence without the reassignment still errors.

While testing, I also found a related crash the earlier versions missed: a
composite reached through a container (e.g. a field of type "t_comp[]")
wasn't tracked, because the recursion stopped at the array. An ALTER TYPE
on the element type then crashed in record_out() and caused a connection
timeout.
v10 iterates domain/array/range/multirange layers to reach the composite
element.

v10 adds regression coverage for all of the above cases.

Attachment Content-Type Size
v10-Fix-bug-19382-server-crash-when-ALTER-TYPE-is-used-m.patch application/octet-stream 34.9 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2026-07-08 00:08:12 Re: EXPLAIN (VERBOSE) fails with for JSON_ARRAYAGG/JSON_OBJECTAGG + window function
Previous Message Michael Paquier 2026-07-07 22:15:16 Re: BUG #19519: REPACK can fail due to missing chunk for toast value