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

From Jakub Wartak
Subject Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date
Msg-id CAKZiRmwfBySmwReFJwqi_-y-2uezRiX15VPT2kizsCAzdJLraw@mail.gmail.com
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)
List pgsql-hackers
On Thu, Oct 30, 2025 at 4:06 AM Bryan Green <dbryan.green@gmail.com> 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:

[03:57:44.552] ------------------------------------- 8<
-------------------------------------
[03:57:44.552] stderr:
[03:57:44.552] #   Failed test 'backtrace has valid format'
[03:57:44.552] #   at
C:/cirrus/src/test/modules/test_backtrace/t/t_windows_backtrace.pl
line 106.
[03:57:44.552] #   Failed test 'Unable to determine scenario -
PostgreSQL should always have export symbols'
[03:57:44.552] #   at
C:/cirrus/src/test/modules/test_backtrace/t/t_windows_backtrace.pl
line 180.
[03:57:44.552] #   Failed test 'Scenario mismatch: expected 2, got 0'
[03:57:44.552] #   at
C:/cirrus/src/test/modules/test_backtrace/t/t_windows_backtrace.pl
line 224.
[03:57:44.552] #   Failed test 'PL/pgSQL error has deeper stack (found
0 frames)'
[03:57:44.552] #   at
C:/cirrus/src/test/modules/test_backtrace/t/t_windows_backtrace.pl
line 318.
[03:57:44.552] #   Failed test 'multiple rapid errors produced
backtraces (0 addresses found)'
[03:57:44.552] #   at
C:/cirrus/src/test/modules/test_backtrace/t/t_windows_backtrace.pl
line 366.
[03:57:44.552] # Looks like you failed 5 tests of 19.

Anyway, as expected this was thrown:
2025-10-30 03:57:37.973 GMT client backend[244] t_windows_backtrace.pl
BACKTRACE:  backtrace generation is not supported by this installation

Please see attached files for convenience as I already had them on
disk. They are from https://commitfest.postgresql.org/patch/6116/ ->
https://cirrus-ci.com/task/5155398535086080 -> artifacts.

Instead of
    +# Skip if not Windows
    +if ($^O ne 'MSWin32')
    +{
    +    plan skip_all => 'Windows-specific backtrace tests';
    +}

Maybe we could also bypass MINGW too like below ? (but I have no
access, so i havent tried)
    use Config;
    # Skip if not Windows or MINGW/MSYS is detected
    if ($^O ne 'MSWin32' || $Config{'ccname'} =~ /gcc|mingw/i ||
defined($ENV{'MSYSTEM'}))
    {
        plan skip_all => 'Windows-specific backtrace tests';
    }

-J.

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: display hot standby state in psql prompt
Next
From: Nazir Bilal Yavuz
Date:
Subject: Re: Improve docs syntax checking and enable it in the meson build