Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rZX0H-004zP2-Uo for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Feb 2024 14:09:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rZX0H-00ABcb-0B for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Feb 2024 14:09:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rZX0G-00ABcT-Kh for pgsql-bugs@lists.postgresql.org; Mon, 12 Feb 2024 14:09:48 +0000 Received: from meesny.iki.fi ([2001:67c:2b0:1c1::201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rZX0D-006NHj-8U for pgsql-bugs@lists.postgresql.org; Mon, 12 Feb 2024 14:09:47 +0000 Received: from [192.168.1.115] (dsl-hkibng22-54f8db-125.dhcp.inet.fi [84.248.219.125]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4TYRD33rZ7zyNC; Mon, 12 Feb 2024 16:09:39 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1707746980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y3vgmO+//J/plfH4dLUpT49cMuncAYzYNKPwHvLH/7A=; b=GY5vlUdgoiPYLK62GkGM6wdNMQu0r8dvQpWHgMvc0eJppSzIzv/riLb010OA/vcllT3bwk oeTGFHs7b2nbEgmLQOrT7Pg/ncbGXT7bbb9ztNKYcQPArJJqekAE+kN8r3xK+zIroSfz7X DHIE/WwRWIz6WboG4KVCbGt1WSc098g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1707746980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y3vgmO+//J/plfH4dLUpT49cMuncAYzYNKPwHvLH/7A=; b=YG43Jv+mN/tddle+Fs4LIwMLC3cGpw8nG8a4qHI7+WRwkYeWOThUk70RbeT9CyT/w2fGuZ Ysm5cO/2UtuKrkRFOTp/Ojm2tb1qUhts/rLrYl5mBR6Lt4sGzOVG9T8uaXKztI+MfMyqBW UAJ4qG+Yr83mwiqSTvCHzAx69BGBpWw= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1707746980; a=rsa-sha256; cv=none; b=sRh2yfdBMmBzJVti3YDgctR4p4UmUHGwNyzB6YQuBSbTQ+Fi0JJ7iJ4jBfEJepMTlBaNdF /71s3g+nPSKmOStK+gjnSo1q1G9QOZDQbhtuEWLpDg06yKvjOqfocMlwZOBODJmg/FUIx9 klVqv0favk6x1CsxgAZAL0ELLxe6Ps0= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: Date: Mon, 12 Feb 2024 16:09:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18338: Memory leak in function 'dumpRule' Content-Language: en-US To: jora.gevorgyan@rau.am, pgsql-bugs@lists.postgresql.org References: <18338-ddb9deb8f1646d01@postgresql.org> From: Heikki Linnakangas In-Reply-To: <18338-ddb9deb8f1646d01@postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/02/2024 15:36, PG Bug reporting form wrote: > The memory leak is found by a static analyzer developed at [CAST]( > https://www.linkedin.com/company/cast-center/). > > The memory alocated at [in qtabname]() is getting lost when function > [pg_fatal is > called](https://github.com/postgres/postgres/blob/09eb633e1baa3b7cd7929f3cc77f9c46f63c20b1/src/bin/pg_dump/pg_dump.c#L18007) No. pg_fatal() calls exit(1). It's not a leak when you exit the process; that will certainly release the memory. There are hundreds of pg_fatal() calls in pg_dump, so I wonder why the tool picked on that one in particular. But it's not a bug. -- Heikki Linnakangas Neon (https://neon.tech)