Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vi7aq-00FZYU-04 for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Jan 2026 09:00:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vi7ao-00HGaE-2T for pgsql-bugs@arkaria.postgresql.org; Tue, 20 Jan 2026 09:00:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vi3tT-00FzEj-2F for pgsql-bugs@lists.postgresql.org; Tue, 20 Jan 2026 05:03:08 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vi3tR-001SJ0-38 for pgsql-bugs@lists.postgresql.org; Tue, 20 Jan 2026 05:03:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=pseAtXg+ZoRSLhoo4kiCFzR06KrqYAaSgCPtxoV65k0=; b=6WHREkLUbfHoC2mBL9+XK/IE6h Sf5oW/HX6xhAsrdbyVAVn3KSC06uYQo2OlOYoEadOJe7g6HwTx6PPJe5j2J29FOVYq2QStELbd4Fg +IhXcMAOF9LBMuVgZlYGzJ0a50D3PHUqypP2QpDwjoTiwbafkLuXxx6gu/i8cHFzKj+AwViwiv+Vp QoVy2C1QLOk3CA+DoYpCojievIBsQpmiFoVwQFCiA+HTv/m5SMCi2RCmaDZqL8oPNoXwBq83ewqt1 kkIDTrA8zFbtgA8LUlNdLHsRkKLVc5HtOsveWcZrpuL8hrLXlLfpxyFzWw+juyNw+JligPBAShVPw j+zk2MJw==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vi3tP-003yBV-2E for pgsql-bugs@lists.postgresql.org; Tue, 20 Jan 2026 05:03:04 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vi3tO-006etl-0Q for pgsql-bugs@lists.postgresql.org; Tue, 20 Jan 2026 05:03:02 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19382: Server crash at __nss_database_lookup To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: dllggyx@outlook.com Reply-To: dllggyx@outlook.com, pgsql-bugs@lists.postgresql.org Date: Tue, 20 Jan 2026 05:02:19 +0000 Message-ID: <19382-4c2060ffee72759b@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19382 Logged by: Yuxiao Guo Email address: dllggyx@outlook.com PostgreSQL version: 17.7 Operating system: Ubuntu 20.04 x86-64, docker image postgres:17.7 Description: =20 Hi, I found a crash in PostgreSQL. Here are the details: PoC: DROP FUNCTION IF EXISTS bar(); DROP TYPE IF EXISTS foo CASCADE; CREATE TYPE foo AS (a INT, b INT); CREATE FUNCTION bar() RETURNS RECORD AS $$ DECLARE r foo :=3D ROW(123, power(2, 30)); BEGIN ALTER TYPE foo ALTER ATTRIBUTE b TYPE TEXT; RETURN r; END; $$ LANGUAGE plpgsql; SELECT bar(); DROP TYPE IF EXISTS foo CASCADE; CREATE TYPE foo AS (a INT, b INT); BEGIN; DECLARE c CURSOR FOR SELECT (i, power(2, 30))::foo FROM generate_series(1,10) i; FETCH c; ALTER TYPE foo ALTER ATTRIBUTE b TYPE TEXT; FETCH c; COMMIT; Stacktrace: #0 0x7182a7813b38 (__nss_database_lookup+0x284b8) #1 0x91c9e5 (textout+0x85) #2 0x94cbd3 (OutputFunctionCall+0x33) #3 0x8db524 (record_out+0x244) #4 0x94cbd3 (OutputFunctionCall+0x33) #5 0x49fafc (printtup+0x2bc) #6 0x7fc888 (RunFromStore+0xa8) #7 0x7fbeb5 (PortalRunSelect+0x75) #8 0x7fbbbe (PortalRun+0x16e) #9 0x7fadd5 (exec_simple_query+0x585) #10 0x7f8929 (PostgresMain+0x949) #11 0x7f45bf (BackendMain+0x3f) #12 0x75df24 (postmaster_child_launch+0x94) #13 0x762101 (ServerLoop+0x1d61) #14 0x75faab (PostmasterMain+0xd8b) #15 0x6a3349 (main+0x2f9) #16 0x7182a76ac083 (__libc_start_main+0xf3) #17 0x49006e (_start+0x2e)