Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUpsh-0039W6-L8 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 16:23:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tUpsf-00A0Cx-Ti for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 16:23:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tUpsf-00A0CW-8o for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 16:23:05 +0000 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tUpsb-000B5h-19 for pgsql-hackers@postgresql.org; Mon, 06 Jan 2025 16:23:02 +0000 Received: by mail-qv1-xf29.google.com with SMTP id 6a1803df08f44-6d8edad9932so94999086d6.0 for ; Mon, 06 Jan 2025 08:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1736180580; x=1736785380; darn=postgresql.org; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=jqxYT4ynJCYaf+GfaoHPj46P9LRShVUrYPDMSlGM0XM=; b=Q3lxtwsVvbWfQM5vuaO0PlMwvDFjpEV9CDQhk21bkSwq3yUv5FmbW/QQZ3VmEAabx/ dS8Tp3kwPGgIce3yG0y0Og6aanSVFBbEmdH5J1xgk3PJ5ujx4SR7z+JLcAoqMhoM5MiE cO0zfhh1yVaV1dTOn1ucrHpXOMji214lzl15+z/YCQCWVV+Bq07j+hA7ee38VcnD+kRC Lbi0OEWJ4c4ADFg7aL7VtS8v7/UXlAnSOGjBoizncvRXLkSApmh1kAD1mScpqBv0sD8j vrrhods/4pVfEGvdQbvM0SwT8o741gRqHTdZaTlnT/Zak5eOxIbkYs6WjVQP8/pP/JPs KVQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736180580; x=1736785380; h=in-reply-to:autocrypt:content-language:from:references:cc:to :subject:user-agent:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jqxYT4ynJCYaf+GfaoHPj46P9LRShVUrYPDMSlGM0XM=; b=R86PORPxlqXul7CDHE2q+9MVx0O6PpQohol/Ms/4XVhzGKp9viQr2e4PsvruIAi5CC kJC+eRmcm+8kwmC/xJwI/+8EHax35M6hq9asGRzfBW+iMpDWz05GkXV3oUgqsDpoA2jp aTW/X7i5iu8EvqH0+zzX2i61fX53y2fq5PlpMFFYRq4osKGN+B0ORKBavaKSPBuq2m3r hZbC0AWQOi/LZj/2Db9Abg3AjdX1o5TSbUBk3JvTL8httJ5FNFxhvjMFqeLrOht8f1wc V04R1F0AdLCBREOJkeB+bun7hx9VEYJNarhuyNTOvMeo97NgOrQqMni5rtR07zwB0ji4 z2Nw== X-Forwarded-Encrypted: i=1; AJvYcCWS0H2qbTQ+nIuv5JOmbpbsCZ187sGOZrS5b1Xe6qkXiU9sEKVblOIEmaJQzPhiYDLSQnCF+WoNal/PPJ/Y@postgresql.org X-Gm-Message-State: AOJu0YyKmQpaCGqDbvmDUuGKLcg2yhWNW1WSM0XjwtADpc+sLcAMITcd pGGHFHNWnC4N52mtcSuG287h/xiFz6MrJ5Jtj8dC5uFOGN+dwx3Xib9CKGtmrWc= X-Gm-Gg: ASbGncvoCKbi1I3NhPMYxgGWPfjvu2bvMYSwF2TC4RyiL1Q17OeUOvex5eBciF1ZSXN zraUD7SV8CXyUxJ+l+9uYh8XGC5D/mHc5gAyVN2LsZnHbQn9Qzfz0j3yAoDN/dJBFGCrohamiaA /Qr3SM/l7yhkRNhdFUUSLzi2Jl9i6eOPXFdQWOnCUTOkJUb+j56ViP6BB2NLh3pmzL//SWwAfva ZlyzumT7Xp2715gqM0plZolOns/cET12NjeSQtgwXJFDCAy+v5BWc0VX5BO9MOQdwM= X-Google-Smtp-Source: AGHT+IF4GGzqeffHaIvWOo4NWTJUY4D/K1ozaETrwLgkXA4pCwW9N/UBmuGQFJrKIYVzJhQpmYwktQ== X-Received: by 2002:a05:6214:27e8:b0:6d8:7db7:1f2e with SMTP id 6a1803df08f44-6dd23338823mr798355206d6.14.1736180580261; Mon, 06 Jan 2025 08:23:00 -0800 (PST) Received: from ?IPV6:2605:a601:a681:6b00::1cc? ([2605:a601:a681:6b00::1cc]) by smtp.googlemail.com with ESMTPSA id 6a1803df08f44-6dd181d75c8sm171303546d6.116.2025.01.06.08.22.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jan 2025 08:22:59 -0800 (PST) Content-Type: multipart/alternative; boundary="------------sNv4qgqDXOBjcwhi49XES5eZ" Message-ID: <69ae171b-87b5-463e-8f60-671a083d2e63@dunslane.net> Date: Mon, 6 Jan 2025 11:22:53 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Windows pg_basebackup unable to create >2GB pg_wal.tar tarballs ("could not close file: Invalid argument" when creating pg_wal.tar of size ~ 2^31 bytes) To: Thomas Munro Cc: Robert Haas , Jakub Wartak , PostgreSQL Hackers , Dilip Kumar References: From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xk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rF2jXbsFgelWnbPWAvXY+pD0dXOFRkagGmC/viwBDqq5b 5tk76kKmUbZxABEBAAHCwHwEGAEIACYCGwwWIQTkPlhGHfx8v0RpFaWZ+n/LWfw7gQUCZFlx 5wUJGVGAjgAKCRCZ+n/LWfw7gf+iB/4g8CPY5jihf5r/8EsoIGe2H+dpVmpPF8YGBzTIvCz/ fQoOq8AX/pE76QEuFnFZWfjw+wgBXgCVmkox2Eflkk6z4ND3pcwGZ6CfCxTQCDk/dij+2DQ4 6bmDCy/sBgcbz9mTpoLC11HLoPae6YN9nBNQRZDcEFEu54OaVOqlIdbA6m+POIBCXZdHOFc0 WoDTgxHRzC1jgQNidyd6tKqcsVJs0dzF0oKTmFFmUAqTdJO12LBuNA1rlqrR3EtpYk8B/wtS 5dIMD7Q8hwQpL+4C6GNpb6ZKnPkLi47pDOLhz2qBrqN+rqUEsT3YnExYpzj5yOBi+FlmV1Hw 49QYe1sn2ZPs In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------sNv4qgqDXOBjcwhi49XES5eZ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-12-07 Sa 2:42 AM, Davinder Singh wrote: > > On Fri, Dec 6, 2024 at 11:31 AM Thomas Munro > wrote: > > Some better new: > > 1.  _chsize_s does in fact seem to work in an msvcrt.dll build. > Thanks to Andres for testing that for me on Windows with a standalone > 2 line program on ucrt and msvcrt runtimes. > > 2.  MinGW always has _chsize_s, but it does more or less what I had > been proposing already if it can't find the function by the Windows > thing like dlsym, so there's no point in writing another thing > like that. > The test was with a 3G file though so it was the real function. > > https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-crt/secapi/_chsize_s.c > > 3.  After a long time trying various ways to make it tidy and getting > incomprehensible results I eventually realised that precompiled > headers were causing strange results on MinGW/Meson builds (on CI), > due to fighting over macros with this guy: > > https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/crt/unistd.h > > I found it easiest to completely stop it from getting in our way > completely, with the attached.  Thoughts, anyone? > > Davinder, Jakub, are you in a position repro the issue and make > versions of the patch for the 13, 15 and master branches on top of > that? > > > Yes, Thomas, the issue is reproducible. > After applying your patch and replacing off_t with pgoff_t, the > problem has been resolved. I have attached the patches for the 13, 15, > and master. These patches include only the changes related to pgoff_t, > intended for use with the v3-0001 patch-- > > Hi, Thomas, Do you have a plan for moving ahead with this? cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------sNv4qgqDXOBjcwhi49XES5eZ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2024-12-07 Sa 2:42 AM, Davinder Singh wrote:

On Fri, Dec 6, 2024 at 11:31 AM Thomas Munro <thomas.munro@gmail.com> wrote:
Some better new:

1.  _chsize_s does in fact seem to work in an msvcrt.dll build.
Thanks to Andres for testing that for me on Windows with a standalone
2 line program on ucrt and msvcrt runtimes.

2.  MinGW always has _chsize_s, but it does more or less what I had
been proposing already if it can't find the function by the Windows
thing like dlsym, so there's no point in writing another thing like that.
The test was with a 3G file though so it was the real function.

https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-crt/secapi/_chsize_s.c

3.  After a long time trying various ways to make it tidy and getting
incomprehensible results I eventually realised that precompiled
headers were causing strange results on MinGW/Meson builds (on CI),
due to fighting over macros with this guy:

https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/crt/unistd.h

I found it easiest to completely stop it from getting in our way
completely, with the attached.  Thoughts, anyone?

Davinder, Jakub, are you in a position repro the issue and make
versions of the patch for the 13, 15 and master branches on top of
that?

Yes, Thomas, the issue is reproducible.
After applying your patch and replacing off_t with pgoff_t, the problem has been resolved. I have attached the patches for the 13, 15, and master. These patches include only the changes related to pgoff_t, intended for use with the v3-0001 patch--




Hi, Thomas,


Do you have a plan for moving ahead with this?


cheers


andrew

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