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 1vDTbW-009qfC-2k for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Oct 2025 20:14:09 +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 1vDTbV-009D7T-1T for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Oct 2025 20:14:08 +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.94.2) (envelope-from ) id 1vDTbU-009D7L-63 for pgsql-hackers@lists.postgresql.org; Mon, 27 Oct 2025 20:14:07 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vDTbP-004ZmU-2T for pgsql-hackers@postgresql.org; Mon, 27 Oct 2025 20:14:06 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 9BBDDEC0357; Mon, 27 Oct 2025 16:14:00 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-06.internal (MEProxy); Mon, 27 Oct 2025 16:14:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1761596040; x=1761682440; bh=oceDR+hhYdIb3ChESWN1icmPn+X4vFVoSLV9kiCx+Fc=; b= RotWPbubi/u6x7ZzEa8nTRwC33u32brwLEQsXAhFF/wyulpaE7rckrnUvc/rq3qq N3uyZ7END5yP2nnM/a3RqRjck7AFFnQKqZjEeZc1yizdAxgXV6UPW/3wGOeffGfO FrKuEqXoDb8sr4E1gwCr1IL1L+YKATi8e5NQwXqWNI9MEWRjVYJxlXOqaVVfz6SU 2QJXKJo7Ck/jshBNAASLZ1Y1qTvcgzTl+UtCGfQpBQwf2ad7KisvZ1JyXArx3G7C FrUfPsNrVDKZXbCYZEtec5cXTlksk+9mkcr8pVADNFyUOsTXLuJfhZSgRIo4x062 G1V8fSfgxnvG4XnptlVBJw== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1761596040; x= 1761682440; bh=oceDR+hhYdIb3ChESWN1icmPn+X4vFVoSLV9kiCx+Fc=; b=W jUhTHUjNvr+qXHlzFoTQjunWpHkWiCAzd8KTsI6WjGAcM+VPZfVB7Y1groEuyj0B uZ08PLomh5CBaEfDIMyWUuRBknh+f16f8oCDU7veJbAM1Hx/WTl/DahGBCSaASup Jv4AxbKxDlq5IWj8FT8EuWtkHqooMMGRo6gNEsqS3ZsHydkt7bafL7YVFBbFn2tz YyYzYXhE1gizecPCnKIIXQgU9NGjhkf4Pnx+soM+XlKfQUqQX64Vata/kwaALOaT FFFLRprRJI+ai9NqbVUWC1zn6X2VUMntx3Q0L4mrAtGUt3r9rb+lgVTU49lEDj1W 2RtrPRusl6yFvD9rcmzyg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduheekledtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfgfhulhgv rhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecuggftrf grthhtvghrnhepleevgfeileegfffglefgfeefffeghfefvdeftdduvdffieeijeffudel iefhvdevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegvuhhl vghrthhordgtohhmpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehjrghkuhgsrdifrghrthgrkhesvghnthgvrhhprhhishgvuggsrdgtohhm pdhrtghpthhtohepuggsrhihrghnrdhgrhgvvghnsehgmhgrihhlrdgtohhmpdhrtghpth htohepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidprhgtphhtthhopehpghhsqhhl qdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 3654D1820054; Mon, 27 Oct 2025 16:14:00 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AWPeZBJywbRF Date: Mon, 27 Oct 2025 17:13:39 -0300 From: "Euler Taveira" To: "Bryan Green" , "Michael Paquier" , "Jakub Wartak" Cc: pgsql-hackers Message-Id: <7379da2a-10e1-4fb2-bd77-212daf4b00b8@app.fastmail.com> In-Reply-To: References: Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only) Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 27, 2025, at 2:58 PM, Bryan Green wrote: > Thanks for even glancing at this. I did not add any regression > tests because the output goes to the server log and not the client. > Since Michael said WIN32-specific tests and mentioned log pattern, he is referring to TAP tests. You can add src/test/modules/test_backtrace that exercises this code path. I didn't test your patch but I'm wondering if we could add an abstraction here. I mean invent pg_backtrace() and pg_backtrace_symbols() that maps to the current functions (Unix-like). On Windows these functions are mapped to win32_backtrace() (that encapsulates CaptureStackBackTrace()) and a new win32_backtrace_symbols() (that encapsulates the rest of the code). There Windows-specific functions should be added to src/port -- my suggestion is win32backtrace.c. Besides that you have to adjust backtrace_symbols in both configure.ac and meson.build so it runs the code path inside HAVE_BACKTRACE_SYMBOLS. -- Euler Taveira EDB https://www.enterprisedb.com/