Fwd: Server closed the connection unexpectedly (memory leak)

From: Zu-Ming Jiang <zuming(dot)jiang(at)inf(dot)ethz(dot)ch>
To: <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Fwd: Server closed the connection unexpectedly (memory leak)
Date: 2023-06-23 16:20:56
Message-ID: bc25534f-5fdf-60db-564d-a4792146ce6e@inf.ethz.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sorry that the test cases is a bit large. It is difficult for me to
reduce it to the minimal, because when I removed some parts, the bug
easily disappears.

Best wishes,
Zuming Jiang

------------------------------------------------------------------------
*From:* Zu-Ming Jiang [mailto:zuming(dot)jiang(at)inf(dot)ethz(dot)ch]
*Sent:* Friday, June 23, 2023 at 6:06 PM
*To:* pgsql-bugs(at)lists(dot)postgresql(dot)org
*Subject:* Server closed the connection unexpectedly (memory leak)

My fuzzer finds a bug in Postgres, which makes the connection closed
unexpectedly.  This bug still can be reproduced even after applying the
patch for
https://www.postgresql.org/message-id/flat/b2bd02dff61af15e3526293e2771f874cf2a3be7(dot)camel(at)cybertec(dot)at

--- Steps to reproduce the bug ---
1. /usr/local/pgsql/bin/psql -d postgres -c "drop database redb";
2. /usr/local/pgsql/bin/psql -d postgres -c "create database redb";
3. /usr/local/pgsql/bin/psql -d redb -f pg_testdb55_bk.sql;
4. /usr/local/pgsql/bin/psql -d redb -f unexpected.sql

pg_testdb55_bk.sql and unexpected.sql are attached.

--- Expected behavior ---
No error triggered.

--- Actual behavior ---
The test case makes the connection closed unexpectedly:

psql:unexpected.sql:695: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
psql:unexpected.sql:695: error: connection to server was lost

--- Postgres version ---
Github commit: f5c446e3367527f9db1506d7c38d2f56e20950b6
Version: PostgreSQL 16beta1 on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit

--- Platform information ---
Platform: Ubuntu 20.04
Kernel: Linux 5.4.0-147-generic

Attachment Content-Type Size
pg_testdb55_bk.sql text/plain 13.4 KB
unexpected.sql text/plain 33.9 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-06-24 06:01:25 BUG #17993: FK issue on logical replication table
Previous Message Zu-Ming Jiang 2023-06-23 16:06:34 Server closed the connection unexpectedly (memory leak)