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

From Álvaro Herrera
Subject Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date
Msg-id 202602232005.2cmbj5ougsfv@alvherre.pgsql
Whole thread Raw
In response to Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)  (Bryan Green <dbryan.green@gmail.com>)
Responses Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
List pgsql-hackers
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

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Ed is the standard text editor."
      http://groups.google.com/group/alt.religion.emacs/msg/8d94ddab6a9b0ad3

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: AIX support
Next
From: Tom Lane
Date:
Subject: Re: PSA: Planning to grease protocol connections during 19beta