public inbox for [email protected]  
help / color / mirror / Atom feed
From: =?utf-8?B?c29uZ2ppbnpob3U=?= <[email protected]>
To: =?utf-8?B?c3VyeWEgcG9vbmRsYQ==?= <[email protected]>
To: =?utf-8?B?ZGxsZ2d5eA==?= <[email protected]>
To: =?utf-8?B?cGdzcWwtYnVncw==?= <[email protected]>
Subject: Re: BUG #19382: Server crash at __nss_database_lookup
Date: Thu, 19 Mar 2026 15:53:48 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAOVWO5oSeBouPv0ueVByh+_6EgRCjWh0spSmnF6Cv-TF1twqKg@mail.gmail.com>
References: <[email protected]>
	<CAOVWO5rVBKsjG4YwO_PJQu2OBGp8qUdF1jineYY6Lm3zc6-KWQ@mail.gmail.com>
	<CAOVWO5rbwKgHWLYJMvKuvGxW9eFSk7LADk=ZxDEvwA1uTefvAg@mail.gmail.com>
	<CAOVWO5qN8UXdwMnDa+a7aVq=irGSfm2aeYvEc-uV6j4QHZiyrA@mail.gmail.com>
	<CAOVWO5py4zLPYsnGK1EEzHnC4feTSmbsEZn-BiDgY_=J1P6Wmw@mail.gmail.com>
	<CAOVWO5pbgCVx0zgTr1mxZug2hoGwxZOk+-Owvwg0jaQv9JE3Fw@mail.gmail.com>
	<CAOVWO5r19cctAFKbW24jfMKsD-pkyV21w+z7L3pCPxM1CArtjQ@mail.gmail.com>
	<CAOVWO5oSeBouPv0ueVByh+_6EgRCjWh0spSmnF6Cv-TF1twqKg@mail.gmail.com>

Hi Surya Poondla:

After applying the patch on the master branch, I debugged it and the type mismatch issue is indeed not as bad as before. I haven't looked at this patch much, but I'm a little worried about performance issues here.


I have one more question: Can we iterate through the code first to get the value of `need_conversion`, and then allocate memory and perform subsequent operations only if necessary? Of course, this is just my opinion. Thank you.


Regards,
songjinzhou




songjinzhou
[email protected]



        



         原始邮件
         
       
发件人:surya poondla <[email protected]&gt;
发件时间:2026年3月19日 13:00
收件人:dllggyx <[email protected]&gt;, pgsql-bugs <[email protected]&gt;
主题:Re: BUG #19382: Server crash at __nss_database_lookup



Hi All,

I was able to reproduce the crash on laster master (19), the above patch applies cleanly on postgres 19 and doesn't crash the server.

psql (19devel)
Type "help" for help.

postgres=# DROP FUNCTION IF EXISTS bar();
NOTICE: &nbsp;function bar() does not exist, skipping
DROP FUNCTION
postgres=# &nbsp; DROP TYPE IF EXISTS foo CASCADE;
NOTICE: &nbsp;type "foo" does not exist, skipping
DROP TYPE
postgres=# &nbsp; CREATE TYPE foo AS (a INT, b INT);
CREATE TYPE
postgres=# &nbsp; CREATE FUNCTION bar() RETURNS RECORD AS $$
postgres$# &nbsp; DECLARE
postgres$# &nbsp; &nbsp; &nbsp; r foo := ROW(123, power(2, 30));
postgres$# &nbsp; BEGIN
postgres$# &nbsp; &nbsp; &nbsp; ALTER TYPE foo ALTER ATTRIBUTE b TYPE TEXT;
postgres$# &nbsp; &nbsp; &nbsp; RETURN r;
postgres$# &nbsp; END;
postgres$# &nbsp; $$ LANGUAGE plpgsql;
CREATE FUNCTION
postgres=# SELECT bar();
&nbsp; &nbsp; &nbsp; &nbsp;bar
------------------
&nbsp;(123,1073741824)
(1 row)

postgres=# DROP FUNCTION IF EXISTS bar1();
NOTICE: &nbsp;function bar1() does not exist, skipping
DROP FUNCTION
postgres=# &nbsp; DROP TYPE IF EXISTS foo1 CASCADE;
NOTICE: &nbsp;type "foo1" does not exist, skipping
DROP TYPE
postgres=# &nbsp; CREATE TYPE foo1 AS (a INT, b INT);
CREATE TYPE
postgres=# &nbsp; CREATE FUNCTION bar1(OUT r1 foo1) AS $$
postgres$# &nbsp; BEGIN
postgres$# &nbsp; &nbsp; &nbsp; r1 := ROW(1, 2);
postgres$# &nbsp; &nbsp; &nbsp; ALTER TYPE foo1 ALTER ATTRIBUTE b TYPE TEXT;
postgres$# &nbsp; &nbsp; &nbsp; RETURN;
postgres$# &nbsp; END;
postgres$# &nbsp; $$ LANGUAGE plpgsql;
CREATE FUNCTION
postgres=# SELECT bar1();
&nbsp;bar1
-------
&nbsp;(1,2)
(1 row)

postgres=# DROP FUNCTION IF EXISTS bar2();
NOTICE: &nbsp;function bar2() does not exist, skipping
DROP FUNCTION
postgres=# &nbsp; DROP TYPE IF EXISTS foo2 CASCADE;
NOTICE: &nbsp;type "foo2" does not exist, skipping
DROP TYPE
postgres=# &nbsp; CREATE TYPE foo2 AS (a INT, b TEXT);
CREATE TYPE
postgres=# &nbsp; CREATE FUNCTION bar2() RETURNS foo2 AS $$
postgres$# &nbsp; DECLARE
postgres$# &nbsp; &nbsp; &nbsp; r foo2 := ROW(1, 'hello');
postgres$# &nbsp; BEGIN
postgres$# &nbsp; &nbsp; &nbsp; ALTER TYPE foo2 ALTER ATTRIBUTE b TYPE INT;
postgres$# &nbsp; &nbsp; &nbsp; RETURN r;
postgres$# &nbsp; END;
postgres$# &nbsp; $$ LANGUAGE plpgsql;
CREATE FUNCTION
postgres=# &nbsp; SELECT bar2();
ERROR: &nbsp;invalid input syntax for type integer: "hello"
CONTEXT: &nbsp;PL/pgSQL function bar2() line 6 at RETURN
postgres=# DROP FUNCTION bar();
DROP FUNCTION
postgres=# &nbsp; DROP FUNCTION bar1();
DROP FUNCTION
postgres=# &nbsp; DROP FUNCTION bar2();
DROP FUNCTION
postgres=# &nbsp; DROP TYPE IF EXISTS foo CASCADE;
DROP TYPE
postgres=# &nbsp; DROP TYPE IF EXISTS foo1 CASCADE;
DROP TYPE
postgres=# &nbsp; DROP TYPE IF EXISTS foo2 CASCADE;
DROP TYPE
postgres=# quit

Regards,
Surya Poondla

view thread (13+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: BUG #19382: Server crash at __nss_database_lookup
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox