pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: issue with meson builds on msys2
Date: Mon, 15 May 2023 16:01:39 -0400
Message-ID: <26b0ebdb-3e7c-d562-620d-8e2f17286ff9@dunslane.net> (raw)
In-Reply-To: <20230515193817.ttx4qf3ceqeufls2@awork3.anarazel.de>
References: <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>
	<20230427221828.2qo7z4xb4f7islln@awork3.anarazel.de>
	<236c0354-62b1-0ae1-a252-4c866bc1c5d6@dunslane.net>
	<20230504235413.eibaxlxslo76ipjl@awork3.anarazel.de>
	<2ff71af4-cdee-37b8-525a-2b25afd1769a@dunslane.net>
	<20230515193817.ttx4qf3ceqeufls2@awork3.anarazel.de>


On 2023-05-15 Mo 15:38, Andres Freund wrote:
> Hi,
>
> On 2023-05-05 07:08:39 -0400, Andrew Dunstan wrote:
>> If you want to play I can arrange access.
> Andrew did - thanks!
>
>
> A first observeration is that making the shell command slightly more
> complicated, by echoing $? after pg_ctl, prevents the error:
>
> /usr/bin/perl -e 'system(qq{"bin/pg_ctl" -D data-C -w -l logfile start > startlog 2>&1}) ;system(qq{"bin/pg_ctl" -D data-C -w -l logfile stop > stoplog 2>&1;}) ; print $? ? "BANG: $?\n" : "OK\n";'
> BANG: 33280
>
> /usr/bin/perl -e 'system(qq{"bin/pg_ctl" -D data-C -w -l logfile start > startlog 2>&1}) ;system(qq{"bin/pg_ctl" -D data-C -w -l logfile stop > stoplog 2>&1; echo $?}) ; print $? ? "BANG: $?\n" : "OK\n";'
> 0
> OK


You're now testing something else, namely the return of the echo rather 
than the call to pg_ctl, so I don't think this is any kind of answer. It 
would just be ignoring the result of pg_ctl.


>
> So does manually or or via a subshell adding another layer of shell.
>
>
> As Andrew observed earlier, the issue does not occur when not performing
> redirection of the output. One interesting bit there is that the perl docs for
> system include:
> https://perldoc.perl.org/functions/system
>
>> If there are no shell metacharacters in the argument, it is split into words
>> and passed directly to execvp, which is more efficient. On Windows, only the
>> system PROGRAM LIST syntax will reliably avoid using the shell; system LIST,
>> even with more than one element, will fall back to the shell if the first
>> spawn fails.
> My guesss is that the issue somehow is triggered around the shell handling.
>
>
> One relevant bit: If I use strace (from msys) within system, the subprograms
> (shell and pg_ctl) actually exit with 0, from what I can tell - but 33280
> still is returned. Unfortunately, if I use strace for all of perl, the error
> vanishes.
>
>
> Perhaps are some odd interactions with the stuff that InheritstdHandles()
> does?


I observed the same thing with strace. Kind of a Heisenbug.


>
> Andrew, is it ok if modify pg_ctl.c and rebuild? I don't know how "detached"
> from the actual buildfarm animal the system you gave me access to is...
>

Feel free to do anything you want. This is a completely separate 
instance from the buildfarm animals. When we're done with this issue the 
EC2 instance will go away.

If you use the script just run in test mode or from-source mode, so it 
doesn't try to report results (that would fail anyway, as it doesn't 
have a registered secret). You might have to force have_ipc_run to 0. Or 
you can just build / install manually.


cheers


andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

view thread (24+ messages)  latest in thread

Message-ID: <26b0ebdb-3e7c-d562-620d-8e2f17286ff9@dunslane.net>
Permalink:  ../26b0ebdb-3e7c-d562-620d-8e2f17286ff9@dunslane.net/
Also on:    postgresql.org/message-id/26b0ebdb-3e7c-d562-620d-8e2f17286ff9@dunslane.net

 · 

reply

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: andrew@dunslane.net, andres@anarazel.de, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: issue with meson builds on msys2
  In-Reply-To: <26b0ebdb-3e7c-d562-620d-8e2f17286ff9@dunslane.net>

* 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