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 1vuccr-00GFxX-0C for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Feb 2026 20:33:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vuccq-00FEjq-02 for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Feb 2026 20:33:52 +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.96) (envelope-from ) id 1vuccp-00FEjh-2K for pgsql-hackers@lists.postgresql.org; Mon, 23 Feb 2026 20:33:51 +0000 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vuccm-00000000qsO-3OkN for pgsql-hackers@postgresql.org; Mon, 23 Feb 2026 20:33:50 +0000 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-7982c3b7dfcso25915087b3.0 for ; Mon, 23 Feb 2026 12:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771878829; x=1772483629; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fhe21HaC2ieEz/tOCs/gEiyJAhgPT0kcnYPq2zauIv0=; b=Xeg6jX8HUK9A0PoEbcV/P8h2h8h2UFADO2XfQmanUZ0X1eKumbBtJ5HLjhyID/DS8H MTw4WW4LFe8Tr5xPiEg1G7Reo8h7O/1hSESsxHrNGeD3F4XpNx7fl0JrIEJQHjwWZz9Z r8bMY7HS3s4KprQBk2/GuWoZ+TocpI8wPs3FvB4ynCbNk4SPqEowGcK/pY00uEJF9ebo gAoUZzX137V1tfM7tGWcWZBC2iezIxv3CcPF7zhKvSCyBq01LLjI9KD0xHBAtSHeayR+ qxTluK1Knh3bDN7hrARJzVzdt4/mnLeYebIvDIp28PZWiAPxdoleywJ7yPuOy0lPMAL5 0oOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771878829; x=1772483629; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fhe21HaC2ieEz/tOCs/gEiyJAhgPT0kcnYPq2zauIv0=; b=UjAxk24vAurRZgV5gwvMvBsT94bZkSVe/rgoJZahKQb4BfgLIWznIeartHJ/4ZI7Q0 9FCCCK+Ved8bGvYO6+4xdTuGPKaH4zNlQm17wRRCLY22MS1J1WHbFyt/ZwOEsyiuXQQz 0SYvm8NI/SGBunqYmYMY8reEHT39nQS0bJOEBvitouA+BcwWTtBUmVIsGlRvygF6Yojv mvY3PCGBIKjy4D2EfjdQZLxHl5rw923G56lXePi+rap/2W7yH+FlH3qZJHtSnszHzYdt 8rjEKHFD2s9WAulfUJrFKPOep0EAArP3eUUtrKIdJaVZu6QZvnGEklY52Btx2U3EohxE 0uNw== X-Forwarded-Encrypted: i=1; AJvYcCWQfaVjrlZQ9HIoWjRnYFiBrk1X/vy+/JYgDzxvTgPU/gRhmuIp9yduiVsANy8GYtmS1HS5p37nQ+ec2kXP@postgresql.org X-Gm-Message-State: AOJu0YyFdH4ekaS4HJhxBXVaC+iueZqo8DfQqG1MQ5btacSoMuJOoXIr gwDFXA+mBDkhXsYPqsrqt8IvrzE0Yeam1A9lRApkgkLOvE4t8tViSMIlX8IJkMwv X-Gm-Gg: ATEYQzylciGca4AQm0h3bshKYdXSk3L11H5cudlJVOos23Dvlq/d4BVrgnm7bwX+ihX DsSoyfZxKWueaujJmtjBr5F2NijqmTsp8eeuk5s6/IPM4/5MwpwUUEFrpm4/ov8CqLjPB8+pgCL wUSpfug6rgBfn1WsJ7s8eptx1BqezubV1834FoJGBZWSYZo5n4/BRIREQbDj0TqhsO67Ol8GOMi Xs+HZEWMbYghhaNXBF6xLNkVAiFHTH0yaQje0dj8bLb3jzyY4KS+pyXfid8ms8qLuj6lrjkEnL+ 03KsIwqFRf+BvkM0P+jMfDmH5FwzWD4dgNAk5DE24SdGUW1su0dp1mtXzBLFLxLRLVp0FgI5LQd 6iDCIsBXy+3iBgftk8L2y/ldC7jfn0J2115/n3OcTisnlPJBCe0NjlK3xVHZz7kyFy6ypWpSVHa gHEY8xrwfJb644FzkyEIEI2tBwOFzt145UQTv5HE9xTH2+p2WgngVbSk9csvo2mU8H2XWuVghcp qbh07TOfqT0xh0HPva7ad3yU8dTmUX96W0B X-Received: by 2002:a05:690c:e1a:b0:796:4004:d1d5 with SMTP id 00721157ae682-79829181139mr92783267b3.59.1771878829367; Mon, 23 Feb 2026 12:33:49 -0800 (PST) Received: from ?IPV6:2600:1700:8952:80:e08a:9894:2f23:ace1? ([2600:1700:8952:80:e08a:9894:2f23:ace1]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7982db9427dsm36896927b3.5.2026.02.23.12.33.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Feb 2026 12:33:48 -0800 (PST) Message-ID: Date: Mon, 23 Feb 2026 14:32:55 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only) To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: Euler Taveira , Jakub Wartak , Michael Paquier , pgsql-hackers References: <202602232005.2cmbj5ougsfv@alvherre.pgsql> Content-Language: en-US From: Bryan Green In-Reply-To: <202602232005.2cmbj5ougsfv@alvherre.pgsql> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/23/2026 2:16 PM, Álvaro Herrera wrote: > Hello, thanks for following up. > > However, I was going over the commit message one final time after your > reply, and I noticed that SymInitialize()'s documentation says quite > explicitly: > > "Do not use the handle returned by GetCurrentProcess" > https://learn.microsoft.com/en-us/windows/win32/api/dbghelp/nf-dbghelp-syminitialize > > which is exactly what we do with this patch. > > I think we should DuplicateHandle() on the GetCurrentProcess() handle > (which then obviously needs CloseHandle afterwards). Would you agree? > > Here's the whole thing again with edited commit message and some trivial > stylistic changes. > > > I was amused to discover that Solaris, macOS and FreeBSD all copied the > backtrace() interface from glibc, and the only platform in the buildfarm > other than Windows that seems to lack support for backtraces is Alpine > Linux. > > Regards > Ok, yeah, we should use DuplicateHandle(). -- Bryan Green EDB: https://www.enterprisedb.com