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 1wHKpo-0074g6-22 for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Apr 2026 12:13:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wHKpn-00DuSs-2p for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Apr 2026 12:13: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 1wHKpn-00DuSk-1r for pgsql-bugs@lists.postgresql.org; Mon, 27 Apr 2026 12:13:07 +0000 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wHKpl-00000003Ka8-1MHx for pgsql-bugs@lists.postgresql.org; Mon, 27 Apr 2026 12:13:07 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-79a74765703so93809217b3.3 for ; Mon, 27 Apr 2026 05:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777291984; cv=none; d=google.com; s=arc-20240605; b=cm8bb3Idtpfa7I9QIB8nAS0eMBHp/CwOMsx7zXSZlTOE5ssu66A/U7FpvjxEkXZoMb rotZoJTkDZqqGxp6jLJ1BEXjmxO+l6wYY5euTbeC94xcBYQ/kpcbN0pWxrc7NVEwHe5a G30Sv6PQI9xY6UBU3jwF+FSAtwpqOgPzDo28GxYBVsKdIGvflJTddtaJuLjnd7gjVfoX uQKUPD4aa01HR3gbcQOqyVxAjWzj/xewSxEpUS0F9SdG6h+hvVvVKe42J4r8B33WhvZS ycWHf354wvBJgcF/+bftIFM5/NxSOF3t+58hftFxq9d2hLksHz/qG+nFzhWuRN9KpUO4 6H/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=rW3DgHBW11FWW7SwQoFDqdTIB0t8yTgSr92OnzWGjQA=; fh=EOse0dyM9a5q2rZrslsAOxEpgC17mVD3c4dl1PE21so=; b=JRRXK8dJ5SWJW9e9MBw78Qm1ofieWhaiFUFznuWKHrMGDqx9iXA16TtKyJeznd5luN 6aGNbCHQ1x0eK9npWR3T8fuzEQmI4bTCTGcN/47ucL/dc38t0BTNV8AFGd5DO5UR3Rln H0hsegDQ0NrD0/MlyNyX/6AkZwKnnNvYTjP6g7Erp6xAo8qQ85TfO3lXlWt3qcnPPGpB xaBvlHbAAkaPst3rqVQ9Yz4XreOXy4oP77Wi3tkhpChpmOMx/2dJlZTB/Qv9i2I4m9iA L7EB+3pHj2K6t0FCuOI3SWm4M+c8JP5ZnwXNaW4XwE1FNEZ5rODBP8OKodZXOoArQET3 GbEQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777291984; x=1777896784; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=rW3DgHBW11FWW7SwQoFDqdTIB0t8yTgSr92OnzWGjQA=; b=sWf6fEVPGz0ZP7C/idkU+N2Z3O6tfVQw7Pa3IjbcPcS6Vk79HTAoUFnbtdI5E+Z8kB tzaaqzcUP7qbBrGgXxdnyWBrqs6e/jtG6ONm6SdSnBWEljJn/+p0zpW2RGlY4Zsp2bzb +C1gL5rMbZ0nfuzVs04UF+Sb02CCSUm3UEmfqhvwjZ1WqUGgBch+DSAaE7kyGIikUCPY ww9HnJP6+Sm5fQLl1W2ur+J6mNNV3wTS3+0sc9rj2c2xILvITvFaQ2IX2u6kRrbUJWNa ORZQFNMve+6xU3oOOoKyKw5L+zrlF5+PecGcCFH9vsmO0BLjEkJq50AQ41rTYsitHkvS SQmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777291984; x=1777896784; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rW3DgHBW11FWW7SwQoFDqdTIB0t8yTgSr92OnzWGjQA=; b=QwbkdEQ5NPX73GbOxiP9hw0A1tbCS4DsPdPXXODuBLaChyz1WKLm/lry5c0Ivz7d7I DWyfPvrVtW7Wdil2Vdr7+b8JNsF1kgBlgZYtlrm+AcHPR4z1Wf4cifHJAxG+IpSjamH1 ea+QmRxUTaQ2L4+Vl2hDOCiCwQZmr5/OUI/fxySsJmeTVCuWStnwFJnwhqKnUmKesshu hG/d1HCOvxwGE28eYp8H1cH/BL2N0sbo78g56ACOES0ffCVEOuKi+TATVHzUofhhmERI Qw3pddscVHQYdEcoTjZBHVpkWTV9j+OxqVuK7VeMUKKdMTvFsV5Cjl1xKg5WJm0BsVbd Lbng== X-Forwarded-Encrypted: i=1; AFNElJ9tgmNb0mYCWfh3Od5nKqFwlrxNPCRag/4g4f+CR8MnCwm9J4UbX70c3v67WmPbdjohrVX49kruPFEy@lists.postgresql.org X-Gm-Message-State: AOJu0YzjWZbXXskCeCs0ycmWhBHk3YkGkWwl2SNPQab3hSVDRgfzJTwC IJDxPGiRHZZlQwpvSR+dG4COGmknGGJTnBqywjL52n58d8UXp9O7ygmDb0QFrktp3s37xuEQVAK uHRR7rk1DdITIO5jNcr3R8hue4g5Ay3k= X-Gm-Gg: AeBDiescqwIRPUJT5iorAOnARx7L/Jw2euYvfTLVisOk4ruVB8HMp0Z1ZV+1jCcy7Me t5/RCCsmorU4QBejdbOBfVixczBY3XF2F31u0KnUEYc85teNRJ+9aE7XnkzIDQs7H0Xmgznbm87 2uGfPPN/MfnecSPUIw4cN5G4Ak5T5Y2irnr8rml4Us2IVXAFLsUHpVKRvEZHrVK+kPHe1x46C8/ Kc6saeqIUrW3r098SUFJkMmC4DnhNUfIqDPr8GFeNDG7Gyiht5ViVEZQFo1wDMCCg9qqMLu+wsa 5VX0i3/szqZ335xPM+0IndTsbp7V+9sM6rhVKafmedYc7DMheg== X-Received: by 2002:a05:690c:385:b0:79f:3715:1980 with SMTP id 00721157ae682-7b9ecefbddamr449080797b3.12.1777291983675; Mon, 27 Apr 2026 05:13:03 -0700 (PDT) MIME-Version: 1.0 References: <19468-f4d360e16882e6c0@postgresql.org> In-Reply-To: <19468-f4d360e16882e6c0@postgresql.org> From: Ayush Tiwari Date: Mon, 27 Apr 2026 17:42:57 +0530 X-Gm-Features: AVHnY4LuqMADdoDe9UJtt344LrKSF5NeiGXq3Y4lw8NvivwKniqhrRZ5Xg4IJ4A Message-ID: Subject: Re: BUG #19468: Prevent SIGSEGV on FETCH after ALTER TYPE of cursor rowtype To: haogangmao@gmail.com, pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000059647706507009e1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000059647706507009e1 Content-Type: text/plain; charset="UTF-8" Hi, On Mon, 27 Apr 2026 at 17:03, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 19468 > Logged by: HaoGang Mao > Email address: haogangmao@gmail.com > PostgreSQL version: 17.3 > Operating system: OS: Linux (Docker) > Description: > > Summary: > PostgreSQL crashes with SIGSEGV when a cursor is open over a composite > type and the type is modified via ALTER TYPE during the same transaction, > followed by a second FETCH. > > Reproduction steps (minimal): > 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; > > Expected: Error message (type modified during active cursor) > Actual: Server process terminated with signal 11 (Segmentation fault) > > Confirmed environment: > PostgreSQL 18.3, built from source with --enable-cassert --enable-debug > Docker image: sqleek-pg18-debug:18.3 > Reproduction / stack script: report/postgres/get_stack3.sh > Full stack output: report/postgres/crash_stack4.txt > Looks the same as [1]. Regards, Ayush [1] PostgreSQL: Re: BUG #19466: Server crash (SIGSEGV) when FETCH after ALTER TYPE during open cursor --00000000000059647706507009e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Mon, 27 Apr 2026 at 17:03= , PG Bug reporting form <norep= ly@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:=C2=A0 =C2=A0 =C2=A0 19468
Logged by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 HaoGang Mao
Email address:=C2=A0 =C2=A0 =C2=A0 haogangmao@gmail.com
PostgreSQL version: 17.3
Operating system:=C2=A0 =C2=A0OS: Linux (Docker)
Description:=C2=A0 =C2=A0 =C2=A0 =C2=A0

Summary:
PostgreSQL crashes with SIGSEGV when a cursor is open over a composite
type and the type is modified via ALTER TYPE during the same transaction, followed by a second FETCH.

Reproduction steps (minimal):
=C2=A0 CREATE TYPE foo AS (a INT, b INT);
=C2=A0 BEGIN;
=C2=A0 DECLARE c CURSOR FOR
=C2=A0 =C2=A0 SELECT (i, power(2, 30))::foo
=C2=A0 =C2=A0 FROM generate_series(1,10) i;
=C2=A0 FETCH c;
=C2=A0 ALTER TYPE foo ALTER ATTRIBUTE b TYPE TEXT;
=C2=A0 FETCH c;
=C2=A0 COMMIT;

Expected: Error message (type modified during active cursor)
Actual:=C2=A0 =C2=A0Server process terminated with signal 11 (Segmentation = fault)

Confirmed environment:
=C2=A0 PostgreSQL 18.3, built from source with --enable-cassert --enable-de= bug
=C2=A0 Docker image: sqleek-pg18-debug:18.3
=C2=A0 Reproduction / stack script: report/postgres/get_stack3.sh
=C2=A0 Full stack output: report/postgres/crash_stack4.txt
=

--00000000000059647706507009e1--