From: Andres Freund <andres@anarazel.de>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: issue with meson builds on msys2
Date: Thu, 27 Apr 2023 15:18:28 -0700
Message-ID: <20230427221828.2qo7z4xb4f7islln@awork3.anarazel.de> (raw)
In-Reply-To: <6efeb45a-07f9-2291-c8f8-9fb4abbb6ebc@dunslane.net>
References: <E1poQg3-003Xv9-UZ@gemulon.postgresql.org>
<08dd6053-deee-52e9-954b-eb69232905c9@dunslane.net>
<2506819.1681761221@sss.pgh.pa.us>
<7d7dcc20-ba19-5340-9be8-f255e8b42edc@dunslane.net>
<20230420150652.jciazjap223iznjp@awork3.anarazel.de>
<5bddd941-9819-6655-7a71-3f346050583e@dunslane.net>
<6efeb45a-07f9-2291-c8f8-9fb4abbb6ebc@dunslane.net>
Hi,
On 2023-04-26 09:59:05 -0400, Andrew Dunstan wrote:
> Still running into this, and I am rather stumped. This is a blocker for
> buildfarm support for meson:
>
> Here's a simple illustration of the problem. If I do the identical test with
> a non-meson build there is no problem:
This happens 100% reproducible?
> pgrunner@EC2AMAZ-GCB871B UCRT64 ~/bf
> $ export PGCTLTIMEOUT=300
>
> pgrunner@EC2AMAZ-GCB871B UCRT64 ~/bf
> $ /usr/bin/perl -e 'chdir "root/HEAD/instkeep.2023-04-25_11-09-41";
> system("bin/pg_ctl -D data-C -l logfile start") ; print "fail\n" if $?; '
> waiting for server to start.... done
> server started
Does it happen as well if you use ucrt perl? Not because I think we should
require it, just to narrow the space.
Any chance that doing export MSYS=winjitdebug changes something? There's quite
a bit of similarity with the python issue you've also encountered - python
would just exit with the a failure indicating exit code.
> pgrunner@EC2AMAZ-GCB871B UCRT64 ~/bf
> $ /usr/bin/perl -e 'chdir "root/HEAD/instkeep.2023-04-25_11-09-41";
> system("bin/pg_ctl -D data-C -l logfile stop") ; print "fail\n" if $?; '
> waiting for server to shut down....fail
Hm. I don't remember the details, but in the python case I was able to get
some additional error code somehow, which then indicated that the
child-process failed with the NT status code indicating the equivalent of a
segfault.
I guess system() in msys perl will invoke bash as a shell to execute the
problem. Perhaps the failing program isn't actually pg_ctl, but the shell? If
it is indeed bash, what does the shell report as the exit code of pg_ctl?
E.g. doing something like
system('bin/pg_ctl -D data-C -l logfile stop; echo $?');
Could you do ldd (with mingw's ldd, which understands PE binaries) of meson
and autoconf built pg_ctl on your machine? I wonder if we end up with a
different windows runtime or such. In the python case I had some
circumstantial evidence that the problem was dependent on the windows runtime
version.
Downthread you mention that the issue doesn't happen with IPC::Run - the
biggest difference I can see is that IPC::Run would IIRC not use a shell? Does
the problem "re-appear" if you make IPC::Run use a shell?
Greetings,
Andres Freund
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-committers@postgresql.org
Cc: andres@anarazel.de, andrew@dunslane.net, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
Subject: Re: issue with meson builds on msys2
In-Reply-To: <20230427221828.2qo7z4xb4f7islln@awork3.anarazel.de>
* 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