Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glbh4-0000OX-2w for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jan 2019 15:40:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1glbh2-0002Ll-GA for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jan 2019 15:40:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glbh2-0002Ld-8o for pgsql-hackers@lists.postgresql.org; Mon, 21 Jan 2019 15:40:56 +0000 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glbgy-00045E-Tr for pgsql-hackers@postgresql.org; Mon, 21 Jan 2019 15:40:55 +0000 Received: by mail-yb1-xb43.google.com with SMTP id e12so1178076ybn.10 for ; Mon, 21 Jan 2019 07:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=wa3X2einApgkYMNaj6mZh1QTNP8ne6PcJqXYAdFoEm4=; b=rGFd0i5cfP0BrvrT0BiP7hNANUJE/aGSC9EAPxdskfX1Fyvh0cbvoEUuQEYCB+VgT0 Fd67boxMdv5MwyWYsvWBmOzwOShIbAzOss2JbBBMlBTgaBAu0ZdTqbqETK+HkH0YBv45 t2UT6GRHmjCdAzE7uUIJ9/M+eFnPYvIXYXYUzHGZaw3cyyxIUGvu1x0rIig4azjyfLWd 9wd9P4sqraFphZ9VMht5E71tLq2TAqU+7KTRxhkco7iuNI9qK6ela08dx0j3KBtkkgci FMHuErH0uoI70Io8R9H+AVn4Cu8SZN4HCEHlN9fN3TsueK3H0k59HWxEEye7lIPrmQZ6 g6Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=wa3X2einApgkYMNaj6mZh1QTNP8ne6PcJqXYAdFoEm4=; b=ctV7yrCl2PY7amrPjbC2DAIOXIngOxSQ6VFF6M+qWgBo9ju4On+y7VJDnM4Gs5lmkJ +50/ZTPn6BNr0bK9u7E6lXzzHTP+rYQwVXMvDZhJAP7N2ONsOA9Rk+Bk4G42wafspSRn dtyi9/MpmoS3ih5abidpxVoNuClHPtmYLK5VD4ptmKo67ZLjurvn3bobKrsHs6LK1K3m DiE8kI78XRKBxQTzWJjqPQ806wP/wieAakY6FmCEztbq4CYwAcrXlVCQ7yaqpuMg7qul 6VaBp/HSrOvS7COrjN4d+Xmcvu8KBjwq+m/7Fpq3gCBLS87rUsxwgQeau8RpILeeRpAS e3sg== X-Gm-Message-State: AJcUukfZYtMD4CB2kkD/UWJBvZktqvitRPWAyGE+WEQy8dv07SZBPLzw z5qWye/pdMA/pI0Y7axelS/u6u818mgEO9YFdC/J/cKJd+U5U+JaAmP7AWAGrRbLugVhTYJJe8N xwS5TsiZHQ7tNVgBtt4f3VMB3OOQXhUiumo1XvfQGTYVG2gz+NwUKmHWa+9U2O4uy2MEF0j3IP5 loxVyp+Gbn7240 X-Google-Smtp-Source: ALg8bN7GDrLB4F2rOGejcG2t6Qm6ukrpcK0jARvq4jnhGauznOW2iVLI4GexHEBpZYMSUify7QvKCA== X-Received: by 2002:a25:8291:: with SMTP id r17mr12551948ybk.329.1548085249830; Mon, 21 Jan 2019 07:40:49 -0800 (PST) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id s185sm9418585yws.69.2019.01.21.07.40.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jan 2019 07:40:49 -0800 (PST) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: [PATCH] pgbench tap tests fail if the path contains a perl special character To: Fabien COELHO , Tom Lane Cc: =?UTF-8?B?UmHDumwgTWFyw61uIFJvZHLDrWd1ZXo=?= , Alvaro Herrera , PostgreSQL mailing lists References: <201901181927.sbv5o72uu4cc@alvherre.pgsql> <29026.1547841766@sss.pgh.pa.us> <32650.1547843169@sss.pgh.pa.us> <20202.1548035461@sss.pgh.pa.us> Openpgp: preference=signencrypt Autocrypt: addr=andrew.dunstan@2ndQuadrant.com; prefer-encrypt=mutual; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAHNL0FuZHJldyBEdW5zdGFuIDxhbmRyZXcuZHVuc3RhbkAybmRRdWFkcmFudC5jb20+wsCY BBMBAgBCAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAUJDyV6hBYhBOQ+WEYd/Hy/RGkV pZn6f8tZ/DuBBQJcH/EVAhkBAAoJEJn6f8tZ/DuB7BEH/iDWZEbVft2m2MT6SPjARzTupt/l xLLZ/Cl6n2US2hov5+fBbnR5xvECk/YC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:47 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/21/19 4:50 AM, Fabien COELHO wrote: > > Hello Tom, > >> Hm, so bowerbird (a Windows machine) has been failing the pgbench test= s >> since this went in, cf >> >> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dbowerbird&dt= =3D2019-01-20%2004%3A57%3A01 >> >> >> I'm just guessing, but I suspect that bowerbird is using a path spec >> that >> includes a backslash directory separator and that's somehow bollixing >> things. > > This point is unclear from the log, where plain slashes are used in > the log prefix path, and furthermore no strange characters appear in > the log prefix path: > > =C2=A0# Running: pgbench -n -S -t 50 -c 2 --log > --log-prefix=3DG:/prog/bf/root/HEAD/pgsql.build/src/bin/pgbench/tmp_che= ck/t_001_pgbench_with_server_main_data/001_pgbench_log_2 > --sampling-rate=3D0.5 > =C2=A0ok 345 - pgbench logs status (got 0 vs expected 0) > =C2=A0ok 346 - pgbench logs stdout /(?^:select only)/ > =C2=A0ok 347 - pgbench logs stdout /(?^:processed: 100/100)/ > =C2=A0ok 348 - pgbench logs stderr /(?^:^$)/ > =C2=A0not ok 349 - number of log files > >> If so, we might be able to fix it by converting backslashes to >> forward slashes before applying quotemeta(). >> >> It's also possible that on Windows, "glob" handles backslashes >> differently than it does elsewhere, which would be harder to fix >> --- that would bring back my original fear that the appropriate >> quoting rules are different for "glob" than for regexes. > > I'm afraid it could indeed be due to platform-specific behavior, so > testing on the target machine to understand the actual behavior would > help. > > I just tested the current version on my laptop within a directory > containing spaces and other misc chars: Pgbench TAP tests are > currently broken in this context on master, and this may be used to a > collection of issues, not just one, eg pgbench function splits > parameters on spaces which breaks if there are spaces in bdir. > > I'm going to investigate, possibly over next week-end, so please be > patient. > > About windows-specific issues, from File::Glob man page: > > """ On DOSISH systems, backslash is a valid directory separator > character. In this case, use of backslash as a quoting character (via > GLOB_QUOTE) interferes with the use of backslash as a directory > separator. ... """ > > It seems to suggest that quotemeta backslash-on-nearly-everything > approach is not appropriate. > File globbing is not the same thing as regex matching. For example, '.' is a literal character in a glob pattern but a metacharacter in a regex, while ' ' is a literal character in a regex but a globbing metacharacter (but see below), and '*' is a metacharacter in both but has different meanings. quotemeta is intended for regexes but being used here on an expression used for globbing. Perhaps it would be OK we changed back the glob line to use $prefix instead of $qprefix, but kept the use of $qprefix in the later regex. To deal with the issue of spaces in file names (not an issue eher ob bowerbird), we should consider adding this: =C2=A0=C2=A0=C2=A0 use File::Glob ':bsd_glob'; This removes the globbing metcharacter nature of the space character, although it might have other effects that cause pain. See `perldoc File::Glob` cheers andrew --=20 Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services