Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pnjOy-0006Ql-IC for pgsql-bugs@arkaria.postgresql.org; Sat, 15 Apr 2023 17:09:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pnjOx-00065z-3j for pgsql-bugs@arkaria.postgresql.org; Sat, 15 Apr 2023 17:09:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmzug-0004JF-20 for pgsql-bugs@lists.postgresql.org; Thu, 13 Apr 2023 16:35:10 +0000 Received: from zg8tmtyylji0my4xnjqumte4.icoremail.net ([162.243.164.118]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmzua-0006n4-VV for pgsql-bugs@lists.postgresql.org; Thu, 13 Apr 2023 16:35:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mails.tsinghua.edu.cn; s=dkim; h=Received:From:To:Cc:Subject: Date:Message-ID:MIME-Version:Content-Type:Content-Language: Thread-Index; bh=6gLOsftQeUb46/OfhpCvd6QWBULYf0pVXUCC8kb5cho=; b=oczE6Dk5A3MD30fsoy5lTfp60kSJTCk31T0pEMgu00ATnblhVQdngb778gcFlz 4kvI1KjpuvyIbrATa2yi2G+gSQ4m3ae+6rQOJQABDisYxF061H++2hVThR763rqt 0kWVrieOkqKBCy7/jnFu1EMyJvj6tmJ0sGirTEcJ+Z0vk= Received: from LAPTOPJPQFQS7K (unknown [183.172.66.176]) by web3 (Coremail) with SMTP id ygQGZQBn614zLzhkRyodEw--.61915S2; Fri, 14 Apr 2023 00:34:59 +0800 (CST) From: To: Cc: , Subject: =?us-ascii?Q?3._PostgreSQL_Server_Subprocess_Went_down_at_function_'loa?= =?us-ascii?Q?d=5Fcritical=5Findex'_and_the_Client_Cannot_Connect_to_the_D?= =?us-ascii?Q?atabase?= Date: Fri, 14 Apr 2023 00:35:01 +0800 Message-ID: <008f01d96e25$e4bdce70$ae396b50$@mails.tsinghua.edu.cn> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0090_01D96E68.F2E1D1C0" X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AdluJa1YzvUdmInUS/WRJI4KfNqLvA== X-CM-TRANSID: ygQGZQBn614zLzhkRyodEw--.61915S2 X-Coremail-Antispam: 1UD129KBjvJXoW7uw4DZw1Utw4kuw1rWF1fXrb_yoW8Zr17pF nrtFZ0kFW8Jr10qw4fXryUu3WkXaykt345Gr1xGFyxXrW5Xr4q9392kFW5W3W3ZrWDCa4F vFyj9rW09an093DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUm0b7Iv0xC_Cr1lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr1j6rxdM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I 8E87Iv6xkF7I0E14v26rxl6s0DM2vYz4IE04k24VAvwVAKI4IrM2AIxVAIcxkEcVAq07x2 0xvEncxIr21l5I8CrVAYj202j2C_Wr0_Ar1l5I8CrVAqjxCE14ACF2xKxwAqx4xG64kEw2 xG04xIwI0_Gr0_Xr1l5I8CrVCF0I0E4I0vr24lYx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0E x4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwAKzV CY07xG64k0F24lc2xSY4AK67AK6r1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_ Jr0_Gr1lx2IqxVAqx4xG67AKxVWUGVWUWwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1V AY17CE14v26r1Y6r17MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAI cVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42 IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVj vjDU0xZFpf9x07jkF4_UUUUU= X-CM-SenderInfo: him2jjo6pdxz3vow2x5qjk3toohg3hdfq/ List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_0090_01D96E68.F2E1D1C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Description: PostgreSQL Server Subprocess Went down at function 'load_critical_index' and the Client Cannot Connect to the Database PostgreSQL Server Version: PostgreSQL 15.2 on x86_64-pc-linux-gnu, compiled by Ubuntu clang version 12.0.1, 64-bit Discoverer: Jingzhou Fu, Jie Liang and Zhiyong Wu in WingTecher Lab of Tsinghua University and Shuimuyulin ltd Email address: fjz22@mails.tsinghua.edu.cn , wuzy21@mails.tsinghua.edu.cn , ljiee@mail.tsinghua.edu.cn Way to Reproduce with Docker (write the poc content into file PoC.sql): ```bash Way to Reproduce (copy the poc into file PoC.sql): docker container rm some-postgres -f docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres:15.2 # wait the server start . docker exec -i some-postgres psql --user=postgres < PoC.sql docker exec -it some-postgres psql --user=postgres # psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: PANIC: could not open critical system index 2662 ``` PoC: ```sql CREATE VIEW col AS SELECT * FROM pg_catalog.pg_class; CREATE ROLE regress_execute_server_program IN ROLE pg_execute_server_program; ALTER TABLE col ALTER COLUMN b DROP DEFAULT, ALTER COLUMN y SET DEFAULT ('{"This", "is", "' || foo(1) || '", "fantasy"}')::text[]; DELETE FROM col; ``` Backtrace: ``` #0 0x7f0e17e9400b (gsignal+0xcb) #1 0x7f0e17e73859 (abort+0x12b) #2 0x1c9fd9e (errfinish+0xe0e) #3 0x1c69820 (load_critical_index+0xc0) #4 0x1c689bb (RelationCacheInitializePhase3+0x2eb) #5 0x1ce8270 (InitPostgres+0x1e70) #6 0x16e69b8 (PostgresMain+0x478) #7 0x144c17b (BackendRun+0xbb) #8 0x144ad85 (BackendStartup+0x525) #9 0x14481e6 (ServerLoop+0x616) #10 0x1443e0f (PostmasterMain+0x30cf) #11 0x106ebf2 (main+0x5a2) #12 0x7f0e17e75083 (__libc_start_main+0xf3) #13 0x49fc0e (_start+0x2e) ``` ------=_NextPart_000_0090_01D96E68.F2E1D1C0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Description: = PostgreSQL Server Subprocess Went down at function = ‘load_critical_index’ and the Client Cannot Connect to the = Database

PostgreSQL = Server Version: PostgreSQL 15.2 on x86_64-pc-linux-gnu, compiled by = Ubuntu clang version 12.0.1, 64-bit

Discoverer: = Jingzhou Fu, Jie Liang and Zhiyong Wu in WingTecher Lab of Tsinghua = University and Shuimuyulin ltd

Email = address: fjz22@mails.tsinghua.edu.cn  ,   wuzy21@mails.tsinghua.edu.cn&n= bsp; ,  = ljiee@mail.tsinghua.edu.cn

 

Way to = Reproduce with Docker (write the poc content into file = PoC.sql):

```bash<= /o:p>

Way to = Reproduce (copy the poc into file PoC.sql):

 

docker = container rm some-postgres -f

docker run = --name some-postgres -p 5432:5432 -e = POSTGRES_PASSWORD=3Dmysecretpassword -d = postgres:15.2

 

# wait the = server start …

 

docker exec = -i some-postgres psql --user=3Dpostgres < = PoC.sql

docker exec = -it some-postgres psql --user=3Dpostgres

 

# psql: = error: connection to server on socket = "/var/run/postgresql/.s.PGSQL.5432" failed: PANIC:  could = not open critical system index 2662

```

 

PoC:

```sql

CREATE VIEW = col AS SELECT * FROM pg_catalog.pg_class;

CREATE ROLE = regress_execute_server_program IN ROLE = pg_execute_server_program;

ALTER TABLE = col ALTER COLUMN b DROP DEFAULT,

  &= nbsp;           ALTER = COLUMN y

  &= nbsp;           &n= bsp;   SET DEFAULT ('{"This", "is", = "' || foo(1) ||

  &= nbsp;           &n= bsp;           &nb= sp;    '", = "fantasy"}')::text[];

DELETE FROM = col;

```

 

Backtrace:

```

#0 = 0x7f0e17e9400b (gsignal+0xcb)

#1 = 0x7f0e17e73859 (abort+0x12b)

#2 0x1c9fd9e = (errfinish+0xe0e)

#3 0x1c69820 = (load_critical_index+0xc0)

#4 0x1c689bb = (RelationCacheInitializePhase3+0x2eb)

#5 0x1ce8270 = (InitPostgres+0x1e70)

#6 0x16e69b8 = (PostgresMain+0x478)

#7 0x144c17b = (BackendRun+0xbb)

#8 0x144ad85 = (BackendStartup+0x525)

#9 0x14481e6 = (ServerLoop+0x616)

#10 = 0x1443e0f (PostmasterMain+0x30cf)

#11 = 0x106ebf2 (main+0x5a2)

#12 = 0x7f0e17e75083 (__libc_start_main+0xf3)

#13 0x49fc0e = (_start+0x2e)

```

 

------=_NextPart_000_0090_01D96E68.F2E1D1C0--