Probable memory leak with ECPG and AIX

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Cc: "Dr(dot) Michael Meskes" <michael(dot)meskes(at)credativ(dot)com>
Subject: Probable memory leak with ECPG and AIX
Date: 2021-12-10 14:40:50
Message-ID: CAECtzeWMVW=b8=DJje_4F=OG9BeYLh-phLcCxZ-FBpii+O=SBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

Our customer thinks he has found a memory leak on ECPG and AIX.

The code is quite simple. It declares a cursor, opens it, and fetches the
only line available in the table many times. After some time, the client
crashes with a segfault error. According to him, it consumed around 256MB.
What's weird is that it works great on Linux, but crashed on AIX. One
coworker thought it could be the compiler. Our customer used cc, but he
also tried with gcc, and got the same error.

The test case is attached (testcase.pgc is the ECPG code, testcase.sh is
what our customer used to precompile and compile his code). Do you have any
idea why that happens on AIX?

Two queries to create the table and populate it with a single record:

CREATE TABLE foo(
key integer PRIMARY KEY,
value character varying(20)
);
INSERT INTO foo values (1, 'one');

Thanks.

Regards.

--
Guillaume.

Attachment Content-Type Size
testcase.pgc application/octet-stream 946 bytes
testcase.sh application/x-shellscript 219 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-12-10 15:20:02 Re: Non-superuser subscription owners
Previous Message Robert Haas 2021-12-10 14:09:26 Re: Non-superuser subscription owners