pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Noah Misch <noah@leadboat.com>
To: Robert Haas <robertmhaas@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Allow db.schema.table patterns, but complain about random garbag
Date: Sun, 24 Apr 2022 13:09:08 -0400
Message-ID: <22c77d3c-3f90-2451-1f95-ed0d3e196d81@dunslane.net> (raw)
In-Reply-To: <20220423025927.GA1274057@rfd.leadboat.com>
References: <E1nhCcm-000HvW-AT@gemulon.postgresql.org>
	<3a190754-b2b0-d02b-dcfd-4ec1610ffbcb@dunslane.net>
	<3687648.1650636245@sss.pgh.pa.us>
	<a3bce10f-0e9b-4d3b-29c7-a150fc44037e@dunslane.net>
	<CA+TgmoYMsmTzkv13TEoP40JgV9G0PBtwbbQMvBqR_oynKBsB3A@mail.gmail.com>
	<CA+hUKGJwUJ7sT4ehZmHeh_0h1y0nFm7c07Gsmv120AR=gZA+sQ@mail.gmail.com>
	<20220423025927.GA1274057@rfd.leadboat.com>


On 2022-04-22 Fr 22:59, Noah Misch wrote:
> On Sat, Apr 23, 2022 at 09:12:20AM +1200, Thomas Munro wrote:
>> On Sat, Apr 23, 2022 at 8:06 AM Robert Haas <robertmhaas@gmail.com> wrote:
>>> I have to say the fact that IPC::Run does shell-glob expansion of its
>>> arguments on some machines and not others seems ludicrous to me. This
>>> patch may be overtested, but such a radical behavior difference is
>>> completely nuts. How is anyone supposed to write reliable tests for
>>> any feature in the face of such wildly inconsistent behavior?


(I missed seeing the part where I was asked for help earlier on this thread)



> The MinGW gcc crt*.o files do shell-glob expansion on the arguments before
> entering main().  See https://google.com/search?q=mingw+command+line+glob for
> various discussion of that behavior.  I suspect you experienced that, not any
> IPC::Run behavior.  (I haven't tested, though.)  Commit 11e9caf likely had the
> same cause, though the commit message attributed it to the msys shell rather
> than to crt*.o.
>
> Let's disable that MinGW compiler behavior.
> https://willus.com/mingw/_globbing.shtml lists two ways of achieving that.



Yeah. I can definitely confirm that this is the proximate cause of the
issue, and not either IPC::Run or the shell, which is why all my
experiments on this failed. With this patch


diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index c6213c77c3..456c3f31f1 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -77,3 +77,7 @@ struct sockaddr_un
        char            sun_path[108];
 };
 #define HAVE_STRUCT_SOCKADDR_UN 1
+
+#ifndef _MSC_VER
+extern int _CRT_glob = 0; /* 0 turns off globbing; 1 turns it on */
+#endif


fairywren happily passes the tests that Robert has since reverted.


I'm rather tempted to call this CRT behaviour a mis-feature, especially
as a default. I think we should certainly disable it in the development
branch, and consider back-patching it, although it is a slight change in
behaviour, albeit one that we didn't know about much less want or
document. Still, we been building with mingw compilers for about 20
years and haven't hit this before so far as we know, so maybe not.


cheers


andrew

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






view thread (12+ messages)  latest in thread

Message-ID: <22c77d3c-3f90-2451-1f95-ed0d3e196d81@dunslane.net>
Permalink:  ../22c77d3c-3f90-2451-1f95-ed0d3e196d81@dunslane.net/
Also on:    postgresql.org/message-id/22c77d3c-3f90-2451-1f95-ed0d3e196d81@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, noah@leadboat.com, robertmhaas@gmail.com, thomas.munro@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Allow db.schema.table patterns, but complain about random garbag
  In-Reply-To: <22c77d3c-3f90-2451-1f95-ed0d3e196d81@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