Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)

From: Bryan Green <dbryan(dot)green(at)gmail(dot)com>
To: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
Cc: Euler Taveira <euler(at)eulerto(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date: 2025-10-30 09:17:34
Message-ID: f0449782-8d0a-464b-997c-5f491f769576@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/30/2025 2:01 AM, Jakub Wartak wrote:
> On Thu, Oct 30, 2025 at 4:06 AM Bryan Green <dbryan(dot)green(at)gmail(dot)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.
Thanks for the feedback. Apologies for forgetting about filtering mingw
out of the tests. I have made changes to the test as well as
meson.build in the test_backtrace directory to keep it from running on
mingw. My cirrus build is all green across all the platforms. Find v3
attached.

Bryan Green

Attachment Content-Type Size
v3-0001-Add-Windows-support-for-backtrace_functions.patch text/plain 36.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-10-30 09:17:59 Re: Consistently use the XLogRecPtrIsInvalid() macro
Previous Message Heikki Linnakangas 2025-10-30 09:10:43 Re: POC: make mxidoff 64 bits