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.96) (envelope-from ) id 1vue5v-00HGm9-2m for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Feb 2026 22:07:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vue5u-00FfHC-2X for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Feb 2026 22:07:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vue5t-00FfH1-33 for pgsql-hackers@lists.postgresql.org; Mon, 23 Feb 2026 22:07:58 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vue5p-00000000vya-3arK for pgsql-hackers@postgresql.org; Mon, 23 Feb 2026 22:07:57 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 874C17A012C; Mon, 23 Feb 2026 17:07:51 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 23 Feb 2026 17:07:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1771884471; x= 1771970871; bh=bCFF9LGpSqGEKCIk52FB8QEwVKqGjId7CJrtSRdfzd4=; b=n 3tCHksr1pcckI02stYhhk3OEdYIVzWRIrNji0p8w3nwMreRBr+GNVtxGskA4uTqC 8/YTz+afcENdFiBf2l3QFkGulkNtaJ0qKaldIXuBu+ph3C9q6LN8WaaZ2TL6yLNP xZ/UDl5cYsngj+AnLNeBtAgjecSU8xfybIfHXEDIIWQpQxRjdBZs0wngi1F3Ex7+ 47yxIY38tZjxZq1RzhuSUdVOczZ7CMN+js00E5syBTcl86bXH2N+9JwM1xYaRiNH K2yFCFhEhmkfkg89w2CQZbvi/vISgGoxvmVAjlO5zofDE4WAFshH2LPxJlrFaH63 oVZ44kTllqnU8VkDhnn9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1771884471; x=1771970871; bh=b CFF9LGpSqGEKCIk52FB8QEwVKqGjId7CJrtSRdfzd4=; b=f72XwBCe5Z6XH2GKj XG+QMnGv0sfABpeSCqSqhXvWOkDKMO3jrHRzhVQcpwj8eJ7i3SKAFsZIwT6W5GBu x3nCPKnB49jkhqe7GNxUsuefqoCck1RzCplbThA4yw0K7pC9w6TqIDYv8QojUzB5 1S+bT9fHO9K69ppv/cCqKO2RJWfyx5Mk75vRUHso0+lCxvABjQ6uUtwyG4CUHjIV q8N1Ua6bfwzFKkWb3BGcWy2rkjJM2xD5PVYoXvfEJm6EhdSmIeg2N/KXAbnnytzL C6WawIgs33eXYPYAwwi9vSRSEjpv3ueNALsE5TZblUFi8OIJPBcczJaymjIvvIsG 1dNbA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvfeekgedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhho ucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvqeenucggtf frrghtthgvrhhnpeetuedvheffkeevgfeuheevteevkefggedttdeufeeuheduuddthfef fffhjeefffenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgv sehkuhhrihhlvghmuhdruggvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehjrghkuhgsrdifrghrthgrkhesvghnthgvrhhprhhishgvuggs rdgtohhmpdhrtghpthhtohepvghulhgvrhesvghulhgvrhhtohdrtghomhdprhgtphhtth hopegusghrhigrnhdrghhrvggvnhesghhmrghilhdrtghomhdprhgtphhtthhopehmihgt hhgrvghlsehprghquhhivghrrdighiiipdhrtghpthhtohepphhgshhqlhdqhhgrtghkvg hrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Feb 2026 17:07:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1771884467; bh=nbXKjKl9Z/NBICiA3xhhGfSU7Q5lmOOKQsdIYPcMNcU=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=tV9Mqq/8Ltu37aYExQOx9zhy6l0/wt3loR+y3XnbvJw3ft18q6KQkw+06rG3wCnBH q7DrFQMy2VFkLdl5OtNlyaSyyo86/kt0hs7snyQUzRnlejGWCwkotmfpP7zTuk9RSj mmgWWmg6DQoBaycGfqGtf0MszOO0xIzLDAvAwDIyCK9eBT46khbGKUNKU68orMkNns x9j2CK4kILjuE9W8Yju+iGQ1LKseH5h+5ZxtVA0m2Ef6z1P/wGv8b3HExNvircNXbP o+0lW0bpw1gn+IdKyYu15HSqy+AQlP18AyXTa1Af9MDOsK+aZtKxpYXhkjONYZM0VG v9f170d0pRCQA== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id AA1BE78; Mon, 23 Feb 2026 23:07:47 +0100 (CET) Date: Mon, 23 Feb 2026 23:07:47 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Bryan Green Cc: Euler Taveira , Jakub Wartak , Michael Paquier , pgsql-hackers Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only) Message-ID: <202602232201.2d5ez5tbrkg2@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6dea1cfa-1efd-41cb-8d1e-ad35d4304aa3@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Feb-23, Bryan Green wrote: > I have implemented DuplicateHandle and closed the handle in the > appropriate places. I also reset backtrace_process to NULL if > SymInitialize() fails. Patch is attached. Hmm, should then backtrace_cleanup() cope with the case where it's NULL? Also, I wonder what happens if one "backtraceable" error occurs, and we fail to SymInitialize(), then another backtraceable error occurs. Should we do the DuplicateHandle()+SymInitialize() dance again, or should we just give up? The current implementation does the former, I think; but the latter is also easily achievable by setting backtrace_symbols_initialized to true and leaving backtrace_process as NULL; then this case can be detected specifically in set_backtrace() and treated as a case where we just return NULL before attempting anything else. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/