pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Kovalenko <d.kovalenko@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Álvaro Herrera <alvherre@kurilemu.de>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18960: Mistake in test test_simple_pipeline (libpq_pipeline.c)
Date: Sat, 21 Jun 2025 23:42:42 +0300
Message-ID: <5ff4b743-b9ab-4406-92db-d6e00be2b301@postgrespro.ru> (raw)
In-Reply-To: <2790652.1750536063@sss.pgh.pa.us>
References: <18960-09cd4a5100152e58@postgresql.org>
	<1181606.1750280943@sss.pgh.pa.us>
	<2790652.1750536063@sss.pgh.pa.us>

Hello Tom,

Thank you for your interest in this problem.

+    res = PQgetResult(conn);
+    if (res == NULL)
+        pg_fatal_impl(line, "PQgetResult returned null unexpectedly: %s",
+                      PQerrorMessage(conn));
+    if (PQresultStatus(res) != status)
+        pg_fatal_impl(line, "PQgetResult returned status %s, expected 
%s: %s",
+                      PQresStatus(PQresultStatus(res)),
+                      PQresStatus(status),
+                      PQerrorMessage(conn));
+    return res;

As I understand, you have leaks of 'res' when (PQresultStatus(res) != 
status)

I spent the some time to fix a leaks in tests and PG itself here:

https://github.com/dmitry-lipetsk/postgres/commits/D20250617_001-pg_master/

libpq_pipeline.c has not been finished yet but "make check" (under ASAN) 
can already executed without any problems.

I hope, you will find something useful in this branch.

For example, these problems are obvious and can be trivially fixed:

https://github.com/dmitry-lipetsk/postgres/commit/484ec68fcfea77beadc19387721d04ca77abe55f

https://github.com/dmitry-lipetsk/postgres/commit/3213f95cfd3e094d6ece4a9114f30f0204c0d056

https://github.com/dmitry-lipetsk/postgres/commit/0d4497a744bd00e741434aa6e307ed23f348fbc4

https://github.com/dmitry-lipetsk/postgres/commit/6f966657d7e9409dcbd8109d41bdc89f22024324 


I am planning to return and finish this work near time - I want to get a 
clean execution of "make check-world" under ASAN.

Thanks&Regards,

Dmitry Kovalenko






view thread (9+ messages)  latest in thread

Message-ID: <5ff4b743-b9ab-4406-92db-d6e00be2b301@postgrespro.ru>
Permalink:  ../5ff4b743-b9ab-4406-92db-d6e00be2b301@postgrespro.ru/
Also on:    postgresql.org/message-id/5ff4b743-b9ab-4406-92db-d6e00be2b301@postgrespro.ru

 · 

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: pgsql-bugs@postgresql.org
  Cc: d.kovalenko@postgrespro.ru, tgl@sss.pgh.pa.us, alvherre@kurilemu.de, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18960: Mistake in test test_simple_pipeline (libpq_pipeline.c)
  In-Reply-To: <5ff4b743-b9ab-4406-92db-d6e00be2b301@postgrespro.ru>

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

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