Re: Probable memory leak with ECPG and AIX

2022-07-03 Thread Noah Misch
On Sat, Jul 02, 2022 at 11:59:58PM -0400, Tom Lane wrote: > Confirmed that either initializing ecpg_clocale or adding -fno-common > allows the ecpglib build to succeed. (Testing it beyond that would > require another hour or so to build the rest of the system, so I won't.) > > As I said, I was al

Re: Probable memory leak with ECPG and AIX

2022-07-02 Thread Tom Lane
I wrote: > On it now, but it'll take a few minutes :-( Confirmed that either initializing ecpg_clocale or adding -fno-common allows the ecpglib build to succeed. (Testing it beyond that would require another hour or so to build the rest of the system, so I won't.) As I said, I was already leanin

Re: Probable memory leak with ECPG and AIX

2022-07-02 Thread Tom Lane
Noah Misch writes: > On Sat, Jul 02, 2022 at 11:37:08PM -0400, Tom Lane wrote: >> Do you want me to test it on prairiedog? > Sure, if it's easy enough. If not, I'm 87% sure it will suffice. On it now, but it'll take a few minutes :-( regards, tom lane

Re: Probable memory leak with ECPG and AIX

2022-07-02 Thread Noah Misch
On Sat, Jul 02, 2022 at 11:37:08PM -0400, Tom Lane wrote: > Noah Misch writes: > > Thanks for reviewing. Pushed with that comment. prairiedog complains[1]: > > ld: common symbols not allowed with MH_DYLIB output format with the > > -multi_module option > > connect.o definition of common _ec

Re: Probable memory leak with ECPG and AIX

2022-07-02 Thread Tom Lane
Noah Misch writes: > Thanks for reviewing. Pushed with that comment. prairiedog complains[1]: > ld: common symbols not allowed with MH_DYLIB output format with the > -multi_module option > connect.o definition of common _ecpg_clocale (size 4) Blah. > I bet this would fix it: > -locale_t

Re: Probable memory leak with ECPG and AIX

2022-07-02 Thread Noah Misch
On Sat, Jul 02, 2022 at 02:53:34PM -0400, Tom Lane wrote: > This looks solid to me. The only nit I can find to pick is that I'd > have added one more comment, along the lines of > > diff --git a/src/interfaces/ecpg/ecpglib/connect.c > b/src/interfaces/ecpg/ecpglib/connect.c > index 9f958b822c..9

Re: Probable memory leak with ECPG and AIX

2022-07-02 Thread Tom Lane
Noah Misch writes: > I had expected to use pthread_once() for the newlocale() call, but there would > be no useful way to report failure and try again later. Instead, I called > newlocale() while ECPGconnect() holds connections_mutex. See log message and > comments for details. I tested "./conf

Re: Probable memory leak with ECPG and AIX

2022-04-17 Thread Noah Misch
On Sat, Jan 01, 2022 at 04:07:50PM -0800, Noah Misch wrote: > On Sat, Jan 01, 2022 at 11:35:02AM -0500, Tom Lane wrote: > > Noah Misch writes: > > > I get the same results. The leak arises because AIX freelocale() doesn't > > > free > > > all memory allocated in newlocale(). The following progr

Re: Probable memory leak with ECPG and AIX

2022-03-25 Thread Guillaume Lelarge
Le ven. 25 mars 2022, 14:25, Tom Lane a écrit : > Guillaume Lelarge writes: > > Did this get anywhere? Is there something we could do to make this move > > forward? > > No. Write a patch? > I wouldn't have asked if I could write such a patch :-)

Re: Probable memory leak with ECPG and AIX

2022-03-25 Thread Tom Lane
Guillaume Lelarge writes: > Did this get anywhere? Is there something we could do to make this move > forward? No. Write a patch? regards, tom lane

Re: Probable memory leak with ECPG and AIX

2022-03-25 Thread Guillaume Lelarge
Le dim. 2 janv. 2022 à 01:07, Noah Misch a écrit : > On Sat, Jan 01, 2022 at 11:35:02AM -0500, Tom Lane wrote: > > Noah Misch writes: > > > I get the same results. The leak arises because AIX freelocale() > doesn't free > > > all memory allocated in newlocale(). The following program uses > tr

Re: Probable memory leak with ECPG and AIX

2022-01-01 Thread Noah Misch
On Sat, Jan 01, 2022 at 11:35:02AM -0500, Tom Lane wrote: > Noah Misch writes: > > I get the same results. The leak arises because AIX freelocale() doesn't > > free > > all memory allocated in newlocale(). The following program uses trivial > > memory on GNU/Linux, but it leaks like you're seei

Re: Probable memory leak with ECPG and AIX

2022-01-01 Thread Tom Lane
Noah Misch writes: > I get the same results. The leak arises because AIX freelocale() doesn't free > all memory allocated in newlocale(). The following program uses trivial > memory on GNU/Linux, but it leaks like you're seeing on AIX: Bleah. > If you have access to file an AIX bug, I recommen

Re: Probable memory leak with ECPG and AIX

2021-12-31 Thread Noah Misch
On Wed, Dec 15, 2021 at 04:20:42PM +0100, Benoit Lobréau wrote: > * with LDR_CNTRL=MAXDATA=0x1000, we reach 256Mo but there is no > segfault, the program just continues running ; > * with LDR_CNTRL=MAXDATA=0x8000, we reach 2Go and there is no segfault > either, the program just continues ru

Re: Probable memory leak with ECPG and AIX

2021-12-15 Thread Benoit Lobréau
Our client confirmed that the more he fetches the more memory is consumed. The segfault was indeed caused by the absence of LDR_CNTRL. The tests show that: * without LDR_CNTRL, we reach 256Mb and segfault ; * with LDR_CNTRL=MAXDATA=0x1000, we reach 256Mo but there is no segfault, the program

Re: Probable memory leak with ECPG and AIX

2021-12-13 Thread talk to ben
Hi, (I work with Guillaume on this case.) On Sun, Dec 12, 2021 at 8:34 AM Noah Misch wrote: > That almost certainly means he's using a 32-bit binary with the default > heap > size. To use more heap on AIX, build 64-bit or override the heap size. > For > example, "env LDR_CNTRL=MAXDATA=0x80

Re: Probable memory leak with ECPG and AIX

2021-12-11 Thread Noah Misch
On Fri, Dec 10, 2021 at 03:40:50PM +0100, Guillaume Lelarge wrote: > 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. That almost certainly means he's using a 32-bit binary w

Re: Probable memory leak with ECPG and AIX

2021-12-10 Thread Guillaume Lelarge
Le sam. 11 déc. 2021 à 07:52, Justin Pryzby a écrit : > On Fri, Dec 10, 2021 at 03:40:50PM +0100, Guillaume Lelarge wrote: > > 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

Re: Probable memory leak with ECPG and AIX

2021-12-10 Thread Justin Pryzby
On Fri, Dec 10, 2021 at 03:40:50PM +0100, Guillaume Lelarge wrote: > 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