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 1mvwFR-0004bT-5B for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Dec 2021 06:52:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mvwFP-0002QA-Dd for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Dec 2021 06:52:43 +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 1mvwFO-0002Q1-Ml for pgsql-hackers@lists.postgresql.org; Sat, 11 Dec 2021 06:52:42 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mvwFL-00044M-53 for pgsql-hackers@postgresql.org; Sat, 11 Dec 2021 06:52:41 +0000 Received: by mail-il1-x131.google.com with SMTP id t8so10330615ilu.8 for ; Fri, 10 Dec 2021 22:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TbqJ1OnDBpsBG6shuUsITcNUrOiehd3MfJ2lcKFJjjg=; b=LfvwErLtbdUsXrQr2rMFa6ap2Xz7QOd6Ips9xOY1LHUtM3bfZD2qhB1Mht7g6JAWui j5eEoYKjZfpqfup5ARSH8PrrhtK51Z1EJd1cbdfpXDkzdPne/PjxrTwlFI5gJ0tW2935 VU3nXqg++XlSnG3ypkM7pbsdAwBwpqYFEpVGlyiM2QTsNML+zETSY4s6PGnVAc/UTegT /G8Bipmhe/G5NB6dyZt14viNkoErXXBrjbPYLQLiD2l8NYDs5fi9vwgHXwckjcgb9tKv IQAjj9F/ptCIC93Q3piAeuVTyPRfg2aVjdwahIyroAJCvCXw/gKSYTDOqDQsOQrn451I RPEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TbqJ1OnDBpsBG6shuUsITcNUrOiehd3MfJ2lcKFJjjg=; b=KpGAP1X3VENdXwL/Tisp4JqsqyFhBLRlLKhzVUrO5RGgpxgQDBCIfgVCGfxAOdG8mQ m13qv1r98EF0hauQkb9RCPcRZzLRjGE057YIPUTgfe9IzdJdLqvfO9PPnazaGDmuDtFh WeyZYO0OqTmXkxoPwu5x8ZyCcvz24cg2NjPhQYSkpEW2ohnK7KSxgBDqz2nf/4QXTvgC S1mC5F5ieb5SMFUefJ1j1/Pj/HhQy52IPdqXOqE9bpHf93EJnWqO4VwF0PpI2gzRn/6e 4BVCYPhyh/Fw1Gr0AAVH+t6o5uQEMIqCbSpDScjy0nKmYaZDeYiP+Tzgn+XTcs/eyVv9 ENcw== X-Gm-Message-State: AOAM532C9nXtOImp3MuludlW/EtCQP/845seo7BBUCsVMrGr6tbkg5FV 6qVJ2VLN5zB8h6kA1qGviMLURQ== X-Google-Smtp-Source: ABdhPJyna4O8quTs0KJoFX1JLfslY2+vk/gMFuiPjULLCd10MuZuoIlFvJC7aqRZFiAto8hQS0DQjg== X-Received: by 2002:a92:cd82:: with SMTP id r2mr20258400ilb.18.1639205558011; Fri, 10 Dec 2021 22:52:38 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id x18sm3894922iow.53.2021.12.10.22.52.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Dec 2021 22:52:37 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 2A05080078F; Sat, 11 Dec 2021 00:52:36 -0600 (CST) Date: Sat, 11 Dec 2021 00:52:36 -0600 From: Justin Pryzby To: Guillaume Lelarge Cc: pgsql-hackers@postgresql.org, "Dr. Michael Meskes" Subject: Re: Probable memory leak with ECPG and AIX Message-ID: <20211211065235.GL17618@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 > 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. A memory leak isn't the same as a segfault (although I don't know how AIX responds to OOM). Can you show that it's a memory leak ? Show RAM use increasing continuously and linearly with loop count. How many loops does it take to crash ? Could you obtain a backtrace ? -- Justin