From: Bryan Green <dbryan.green@gmail.com>
To: Jakub Wartak <jakub.wartak@enterprisedb.com>
Cc: Álvaro Herrera <alvherre@kurilemu.de>
Cc: Euler Taveira <euler@eulerto.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date: Thu, 30 Oct 2025 08:38:03 -0600
Message-ID: <dfc84b5c-3ff0-446b-84b8-7cbd1a74f566@gmail.com> (raw)
In-Reply-To: <CAKZiRmzuqPmgd_A+M+RiuT-4UtDt_TASqQJoqCdvCUrVY3w7cg@mail.gmail.com>
References: <202510300932.isdvgkzqzshk@alvherre.pgsql>
<5b4c6ce0-ed17-4abb-9127-859cc95cbdf3@gmail.com>
<CAKZiRmzuqPmgd_A+M+RiuT-4UtDt_TASqQJoqCdvCUrVY3w7cg@mail.gmail.com>
On 10/30/2025 3:52 AM, Jakub Wartak wrote:
> On Thu, Oct 30, 2025 at 10:40 AM Bryan Green <dbryan.green@gmail.com> wrote:
>>
>> On 10/30/2025 3:37 AM, Álvaro Herrera wrote:
>>> On 2025-Oct-30, Jakub Wartak wrote:
>>>
>>>> Hi Bryan, cfbot is red. I'm was fan of having those tests for this
>>>> (bring complexity and we didn't have tests for Linux backtrace
>>>> anyway), but now MINGW win32 is failing on those tests where the
>>>> feature is not present:
>>>
>>> I hate to say this after the code is written, but I think we should not
>>> put any tests in the first step. I predict that these are going to be
>>> enormously brittle and that we'll waste a lot of time making them
>>> stable. I think we should commit the Windows support for backtraces
>>> first, then consider whether we actually want TAP tests for the overall
>>> feature. We've gone several years with glibc backtrace support without
>>> any tests -- why do we think the Windows implementation thereof _must_
>>> necessarily have them?
>>>
>> It will not bother me to remove them. It was my first effort at writing
>> TAP tests, so it was a nice learning experience.
>
> Well, that was a typo on my part (stupid me), I wanted to write: I was
> NOT a fan of having those tests for this (in first place) - sorry for
> confusion!
>
> Anyway we have test because I think Michael and Euler triggered this
> but earlier i've tried to persuade NOT to do this (see: `Also is it
> worth it to test that setting backtrace_funciton=FOO really emits
> .*FOO.* in log message cross-platform way?`), anyway Bryan implemented
> this and it looks like v3 has just turned [gG]reen ;)
> (https://cirrus-ci.com/build/6001832838823936)
>
> -J.
The tests are easy enough to get rid of. I think Alvaro has a good idea
of committing the windows support for backtraces and then consider
whether we want TAP tests or not. I will make a v4 patch without the
TAP tests unless someone strongly objects.
The tests don't really test whether this code would be the cause of
cause of a problem, they mainly test whether you are getting the correct
output in your backtrace. If you have a pdb file, you should get
filenames and linenumbers in addition to addresses and symbols. If you
don't have a pdb file you will only get export function symbols and
addresses. So, even if you should have a pdb and don't...you still get
something useful.
Bryan Green
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: dbryan.green@gmail.com, jakub.wartak@enterprisedb.com, alvherre@kurilemu.de, euler@eulerto.com, michael@paquier.xyz
Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
In-Reply-To: <dfc84b5c-3ff0-446b-84b8-7cbd1a74f566@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox