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 1jtJF9-0003rc-KI for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2020 23:12:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtJF8-0001DN-HG for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jul 2020 23:12:46 +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 1jtJF8-0001DF-Ao for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2020 23:12:46 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jtJF6-0004FI-3G for pgsql-hackers@lists.postgresql.org; Wed, 08 Jul 2020 23:12:45 +0000 Received: by mail-qt1-x841.google.com with SMTP id a32so314610qtb.5 for ; Wed, 08 Jul 2020 16:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Kur3Ns9WG8CHxgKwh7fv1LwDNZrr8+fQnpgnRLvjZDQ=; b=gUf9elNiz9SuP0hlatuTcnrw75grXBqfypv99A2JawT3fL0Q9URQW4U09aqqjkOJT0 iXEmGLg0EdeSmZvtHvNTz9yKBo1ckbudBoneIZFvfkXAyI918Dxvj09RA9hVBmNYwAYy /OuIhO6vXcOQItT5Bm1vqa58101QKldZMb4vKqHrn9N1/1+xLRwdYStBbNcl+A6aP/sM woAkU+VCqrTSWAxx+Ifz41J1KRRgbWMT+u889HpxiLf2UZ54wP05MlEBrrTUmokC93TC J48vgIXM9i3nMS2vay2IgyLaYeUEitVT5bMDVFLwkDWVCliuALEuOEohAUXCGxPQiLP4 XN+g== 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:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=Kur3Ns9WG8CHxgKwh7fv1LwDNZrr8+fQnpgnRLvjZDQ=; b=RPkcXaQ+IskbfGakptVcolnMU7GZkJ88uOcYOMk4Anc7C6sbBdDGg1K3AHi9H3IkbX 0PsZaj5QqxjJ+WoU98S27zzybgkH6gVeR7SgDH2DzInzv8esDFqJJLfPGSOgl8Bcq59C ljhvAp6YB3cjxn+YnVDFh2ziX3PjT2UPWK9lN0C4sWUaYaD+wpVQdpcPkBVcXSH60rs/ 5Pzf+l9JVvtC9Yk62SVwOiQRj4oJ2uxx35ICuGPlvY82c9sSzmQU0r526JHrqrzHH9MW 2+IU/jnJRwp1+7wmBYwH/kNvSQCvCrc2muptiBvpzpeK+I8HkESZPbNCQ5jLoJH+DfU+ mqTA== X-Gm-Message-State: AOAM533LIQkvxaNZkUXwp5YtCZbzO2AGOGX6Dr9DCI++FukK7/pB8zC9 YmyUxtjMDcQw+fIZeBbUcB55y+X7EPX3K7QUTtctQ47gGAMl5ccB+ZBeUyjh7iiP21WlvKVN/bL eo0m4yncLCuB8MVTvqt2DN4hdnPnimau2wjrPJiQroVimd8KPjeNPrgIMdaPT+A7hWb7VTCtZje Duj0CcJbRXsodD2gvIjap9 X-Google-Smtp-Source: ABdhPJyojfamznSNysMVzPkgEKOCTN36xer5hr+dFqSQjMuumgmoVG/rhodFQ4yZfnqvptu1f1EL7Q== X-Received: by 2002:ac8:a41:: with SMTP id f1mr53197968qti.89.1594249962609; Wed, 08 Jul 2020 16:12:42 -0700 (PDT) Received: from ?IPv6:2600:1700:722:4630::43? ([2600:1700:722:4630::43]) by smtp.gmail.com with ESMTPSA id 73sm1623697qkk.38.2020.07.08.16.12.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jul 2020 16:12:41 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: Is this a bug in pg_current_logfile() on Windows? To: Tom Lane , Thomas Kellerer Cc: pgsql-hackers@lists.postgresql.org References: <412ae8da-76bb-640f-039a-f3513499e53d@gmx.net> <1716646.1594226496@sss.pgh.pa.us> <1733826.1594243608@sss.pgh.pa.us> Autocrypt: addr=andrew.dunstan@2ndQuadrant.com; prefer-encrypt=mutual; keydata= mQENBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAG0L0FuZHJldyBEdW5zdGFuIDxhbmRyZXcuZHVuc3RhbkAybmRRdWFkcmFudC5jb20+iQFY BBMBAgBCAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgBYhBOQ+WEYd/Hy/RGkVpZn6f8tZ /DuBAhkBBQJd1pSYBQkSzqMsAAoJEJn6f8tZ/DuBJmEIAIVFBIC3qGqh+YTPVTkfowwxpHz0 tZSPjZ6GS/5y62kgoZrZOVXw+Rg2ceuMM3a+In/RRjTx4bembgYqRKgzXlDfiNBJeq5ioVuN H1faDKE2lm5a6QkRQ2JU6DKf60fqSJGP5LisCUr1V0wz6EnlO31ArrKtXCNB+yk0KDAS6o6I Ql4pkXpr+vq4iilwJmiJOqTBam0LmQE7ulYCCYU8Z6MkpiSl+dO7QSramcGyxauQRI3a7gcq dpo8Vrv3gFTQDeMYxk7cqZp08pIVH5XR0+LgBz4X84f59rA/VAKlC/r6CyEQk59rvDLxCMyP 2buoj51Z25N3MVghRDGcsU6mT7e5AQ0ETspYWQEIANGc4zQULOxhbqO2dyD51YhqCNRmm9oK Waqf+wmW4tpDe/VVcxAnNizd4LWCHfzpb5cHAtGkOPePMfzWVf6nvdF7d3eglbtf59+zG7O7 llV0xSSoFiieQBsrGvqDInXYX/4mRRXMtyhM353/tixC9RWLs1oofyYmCPPXXY7h9R7en3B8 BoVrRFcdzlIY/NFNhFGW/9dkEiGjgna2Rk6e15kln4ZvFBWUg23p93w/pqXcxY6+k/8TEk+C 4R+M6w7o2PLGOjdZ+kPiUcw5H85zf/yZJwQXzisXaNduwWB6Vads9YC9dj6kPR1c4VGRqAaY L++LAEOqrlvm2TvqQqZRtnEAEQEAAYkBJQQYAQIADwIbDAUCXdaUtAUJEs6jVQAKCRCZ+n/L Wfw7gQi5B/9sHbmRloZNCWWwZGm+O9iG/JGQxS0WWa4GaZqzqSTWOft2/gO0Bgag89r1djq4 PFgSZtzHvKQpqYz/7HkPrWh1jpcS83i/uYY1uyHXUUtpdEmn4buNObEtD0YNaJkGdhASsECq 6akw+u7WJYmAHs/SpR6ok6HqLw7JHDVc2h5dViLfTk0qrgDa7sq/LVMoJje5Ct/Ku3YaWAV6 YSmzoPP5BmPVFqP11OMQkCqurIu9vTLXKFWX623vCmqRDHJ6e5GCDHbH8USU+4wJBfPymZkd cA7NGm/mmWeJiWBFIDyjzYxrjku8ty9TZJVsaRXnS+OFQzXz9Eu2wTpKdHij46uY Message-ID: <252f062c-2b75-1bc3-e08a-3541719b27c0@2ndQuadrant.com> Date: Wed, 8 Jul 2020 19:12:40 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1733826.1594243608@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/8/20 5:26 PM, Tom Lane wrote: > > However ... I put in a test case to try to expose this failure, and > our Windows buildfarm critters remain perfectly happy. So what's up > with that? After some digging around, I believe the reason is that > PostgresNode::psql is stripping the \r from pg_current_logfile()'s > result, here: > > $$stdout =~ s/\r//g if $TestLib::windows_os; > > I'm slightly tempted to extend the test case by verifying on the > server side that the result ends in ".log" with no extra characters. > More generally, I wonder if the above behavior is really a good idea. > It seems to have been added in commit 33f3bbc6d as a hack to avoid > having to think too hard about mingw's behavior, but now I wonder if > it isn't masking other bugs too. At the very least I think we ought > to tighten the coding to > > $$stdout =~ s/\r\n/\n/g if $TestLib::windows_os; > > so that it won't strip carriage returns at random. > Seems reasonable. If we rip it out completely we'll have to find all the places it breaks and fix them. And we'll almost certainly get new breakage. If it's hiding a real bug we'll have to do that, but I'd be reluctant unless there's actual proof. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services