Re: [PATCH] Add Windows support for backtrace_functions (MSVC only) - Mailing list pgsql-hackers

From Bryan Green
Subject Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date
Msg-id e2c47fc6-fd7c-454b-8ef6-db81447962dd@gmail.com
Whole thread Raw
In response to Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Bryan Green
Date:
Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Next
From: Andrew Dunstan
Date:
Subject: Re: Non-text mode for pg_dumpall