Re: BUG #19382: Server crash at __nss_database_lookup - Mailing list pgsql-bugs

From surya poondla
Subject Re: BUG #19382: Server crash at __nss_database_lookup
Date
Msg-id CAOVWO5o9YOpCTgg6FfNepCoH_6pFSa7TJ3SEWfJAoBvNOb0OdQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19382: Server crash at __nss_database_lookup  (Andrey Borodin <x4mmm@yandex-team.ru>)
List pgsql-bugs
Hi Andrey,

Thank you for the comments.


The server still crashes when only an inner type is altered:

CREATE TYPE inner_t AS (x INT, y INT);
CREATE TYPE outer_t AS (a INT, b inner_t);

CREATE OR REPLACE FUNCTION test_nested() RETURNS record LANGUAGE plpgsql AS $$
DECLARE r1 outer_t; r2 outer_t;
BEGIN
    r1 := ROW(1, ROW(10, power(2,30)::int4)::inner_t)::outer_t;
    ALTER TYPE inner_t ALTER ATTRIBUTE y TYPE TEXT;
    r2 := r1;
    RETURN r2;
END; $$;

SELECT test_nested();   -- server crash

Thank you for the nested composite testcase and the fix in cursor code, the changes look good.. I fixed the PL/pgsql to fix the nested components.
 
Here is the patch for the pl/pgsql fix

Regards,
Surya Poondla
Attachment

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #19452: heap-buffer-overflow in `pg_basebackup --format=tar --gzip`
Next
From: Fredrik Widlert
Date:
Subject: BUG: PostgreSQL 19devel throws internal opfamily error for FK with reordered referenced columns