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 1nJUtz-0007hD-ED for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Feb 2022 06:32:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJUty-0000Vx-9h for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Feb 2022 06:31:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJUtw-0000Vi-HP for pgsql-hackers@lists.postgresql.org; Mon, 14 Feb 2022 06:31:58 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJUtr-0006kK-W4 for pgsql-hackers@lists.postgresql.org; Mon, 14 Feb 2022 06:31:56 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 391FF5C00BC; Mon, 14 Feb 2022 01:31:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 14 Feb 2022 01:31:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=+A7fwQAaS8OSSjNe7MRphUB6H9mR9ByxC3qlAa APGFo=; b=A3DSvwmRnqdWd6bPAKMCJk23mXsu79lRe9qhGcFWXtg1OIRpHCKRKS HIvjD/Vohp//gjPhXM8YOTlyWD9zl2BO0y29RIsEmBwmxKdwRK1hLBcfeSlR9lQn kgVVZ3pv5myjhusTBpphxJG7HZAQO8azZclbXmMIGQtvoJyD3Bp4LcVT22q8Umyj cxaEeIipeH8RzRGsSALjR3dtYGA9V6VU68oG4hWRPHZiLsbh2sAgB5qf82MMm00l IJrmxpll6njOdFkw/ZUWfNSD08GYvltEu7PKOabmrmttcG2LyauaLUSWt1ZmYsTq MLhFoHcQpTBt8TkmL5vXRBY2zS85ApOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=+A7fwQAaS8OSSjNe7 MRphUB6H9mR9ByxC3qlAaAPGFo=; b=UHEvBvJL/TAKFc1wAA7RgQAd3yUcOZEwG 9lSVyg562wInQAl/GslRmatZS0VbvFKecvSuemIMOliZbYNwnk5F9ASZ1MkYorFD DZno42JVOgd0K1soJfkSqe9Qp3rf+tMP6FwtwsVTrwgt0cg06dyXyyZrIiR7QPhn 6F3SHfmKFn6rtUZGDhRbq8SsXVQFDSEEUTCHb7wX5/63GIEVN6JanJaJb+l6TE4S vIrAlmyvO6Oa5CwVGhdMPsd6CDNb7w517JN4d+wuLzM36R17wUbJVAnyc6LoShpd eqjMcreexifMrW5uMYqYLuhr0eETBmGG5nIFv0qAKqu5sEloy63AQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrjedugdelhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddu necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvedtgfekudduueevteefgefgjedu vddtteeuhfelueffueekiefhjefgieegudelnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Feb 2022 01:31:47 -0500 (EST) Date: Mon, 14 Feb 2022 15:31:42 +0900 From: Michael Paquier To: Andres Freund Cc: Juan =?iso-8859-1?Q?Jos=E9_Santamar=EDa?= Flecha , PostgreSQL Hackers Subject: Re: pg_receivewal.exe unhandled exception in zlib1.dll Message-ID: References: <20220211155044.x75ziw7cvbb5p23h@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jmHKxST/3pmM87JZ" Content-Disposition: inline In-Reply-To: <20220211155044.x75ziw7cvbb5p23h@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --jmHKxST/3pmM87JZ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 11, 2022 at 07:50:44AM -0800, Andres Freund wrote: > On 2022-02-11 16:33:11 +0100, Juan Jos=E9 Santamar=EDa Flecha wrote: >> The problem comes from the file descriptor passed to gzdopen() in >> 'src/bin/pg_basebackup/walmethods.c'. Using gzopen() instead, solves the >> issue without ifdefing for WIN32. Please find attached a patch for so. This looks wrong to me as gzclose() would close() the file descriptor we pass in via gzdopen(), and some code paths of walmethods.c rely on this assumption so this would leak fds on repeated errors. > I hit this as well. The problem is really caused by using a debug build of > postgres vs a production build of zlib. The use different C runtimes, with > different file descriptors. A lot of resources in the windows world are > unfortunately tied to the C runtime and that there can multiple C runtime= s in > a single process. It may be worth warning about that at build time, or just document the matter perhaps? I don't recall seeing any MSIs related to zlib that have compile with the debug options. -- Michael --jmHKxST/3pmM87JZ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmIJ904ACgkQnvQgOdby QH2b8Q//R9GXF+HAltu0dDDrrUX1OpdjjFrNIAdgXiFCuag+iIrmJXBHvfQT0H6g hVarGWbMyM1RPv3UEg5Lb5/lUvTj7t7RuwAsKiNR4w/0qdPoZP7cuZK0qEw31TL7 L+RtUUH8B7qCL6LsEVmimmF8cj/GjWXf4isd1+kbDs8LmVz5+P5CGjidNK4znD+E LDEA0fpgR69IdU1nQb5NAMORZE8H2bRbdpxakvk7hZkRLXG0Fk4aekJ/+ndATPQu CDgRYESZNhlEmBvV+fFMOjOr1pBucCKgHUlfOEOrtPav/58x2sq6Qgiuw/lAjEVj 11X30iu4C7AXzCs/sE2Y6IKgineyDR67edsA4tnUTV9Vs3LKbBaR04di6YvtdVc4 zd0KFEChNaK0UGwkO801fvE/StrtOX4LgFkMmNGX0sIM3xamXeuRnQ0Qhu/N7/Cp NaCASDQ7ViJHk6YbF0FJGlIhWNplVCLQGg/pHpCqlhv3Ky+VsA+ZdUw+ceVGbEgQ eWZ+IjV6CuHE1nEvVVp+62gfc2GB0x/qmkMvBWZvZShv1GDKkmN/DY75siWkA+6s a0DZbFwcQaV9U5oAnxJvZ8YqB/+7Vjw3pmZmyyCnv+sO04oj6tFxz+HG3F8laSyW 5fc3DwRFxXDoGgsTDiOx/gNIndzrtVA9JDMR8AbBcqN3l4y5Jrs= =As7A -----END PGP SIGNATURE----- --jmHKxST/3pmM87JZ--