Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prgCJ-0004xv-OT for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2023 14:32:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1prgCI-0005DE-EB for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Apr 2023 14:32:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1prgCI-0005D5-4g for pgsql-hackers@lists.postgresql.org; Wed, 26 Apr 2023 14:32:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1prgCF-0020YN-3Y for pgsql-hackers@lists.postgresql.org; Wed, 26 Apr 2023 14:32:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33QEWY12848512; Wed, 26 Apr 2023 10:32:34 -0400 From: Tom Lane To: Andrew Dunstan cc: Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: issue with meson builds on msys2 In-reply-to: <6efeb45a-07f9-2291-c8f8-9fb4abbb6ebc@dunslane.net> 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> Comments: In-reply-to Andrew Dunstan message dated "Wed, 26 Apr 2023 09:59:05 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <848482.1682519531.1@sss.pgh.pa.us> Date: Wed, 26 Apr 2023 10:32:34 -0400 Message-ID: <848511.1682519554@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: >> For some reason which makes no sense to me the buildfarm animal fails >> at the first Stop-Db step. The DB is actually stopped, but pg_ctl >> returns a non-zero status. The thing that's really odd is that meson >> isn't at all involved in this step. But it's happened enough that I've >> had to back off using meson builds on fairywren - I'm going to do more >> testing on a new Windows instance. > Here's a simple illustration of the problem. If I do the identical test > with a non-meson build there is no problem: > 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 Looking at the pg_ctl source code, the only way I can explain that printout is that do_stop called wait_for_postmaster_stop which, after one or more loops, exited via one of its exit() calls. The lack of any message can be explained if we imagine that write_stderr() output is going to the bit bucket. I'd start by changing those write_stderr's to print_msg(), which visibly does work; that should confirm the existence of the stderr issue and show you how wait_for_postmaster_stop is failing. regards, tom lane