From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.bonedaddy.net (smtp.bonedaddy.net [45.33.94.42]) by sourceware.org (Postfix) with ESMTPS id 7509B3852C41 for ; Thu, 24 Nov 2022 00:08:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7509B3852C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=bonedaddy.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bonedaddy.net Received: from localhost (unknown [49.194.240.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pabs3@bonedaddy.net) by smtp.bonedaddy.net (Postfix) with ESMTPSA id 0DB4D305ED7; Wed, 23 Nov 2022 19:08:16 -0500 (EST) Authentication-Results: smtp.bonedaddy.net; dmarc=fail (p=none dis=none) header.from=bonedaddy.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bonedaddy.net; s=mail; t=1669248498; bh=1Jj8P+cYDEn8Nj343feJFp4GZRWaEJ9KAyOiiI0ENoM=; h=Subject:From:To:In-Reply-To:References:Date; b=hCHCZ4iMsmD5lMIZgy5nsNxDhHy1H7SbhAGr26p+ppQooqTJFf5XKgS3G1OxT2S9c W4w9wsj6a/g6mR+x+TBi/UrRbvhS25wroBYyZUXkr0Rgtj91bUMoNVp2d+LYre0Muc Q5SD87UHhN3DOACuWvz1TnygMwyCb3Fue96pkGOLkHYjt+BYTtgqTbW9eG9kz3PaTz FVf7Q9ajQJHWfNF2tOLrUmEt/z4Ib1Llpap5ZIa6G3228C8cnXNLFakGjcIjouJ+ef ZzlgC9ZbTk33N7AfDlnvSznALiFxKliEws+w/9g03USWs5oUO3AKfZsDLsBGcDlcv6 gqP0MMbQYptqg== Message-ID: Subject: Re: is this a bug in glibc or readpst? From: Paul Wise To: Florian Weimer , Libc-help In-Reply-To: <875yf6nj43.fsf@oldenburg.str.redhat.com> References: <2cefc4fa95dd439c2581f4f06d520c004cd33708.camel@bonedaddy.net> <875yf6nj43.fsf@oldenburg.str.redhat.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-L1+GkxspVgt0rWFZt1uB" Date: Thu, 24 Nov 2022 08:06:41 +0800 MIME-Version: 1.0 User-Agent: Evolution 3.46.1-1 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-L1+GkxspVgt0rWFZt1uB Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2022-11-23 at 09:57 +0100, Florian Weimer via Libc-help wrote: > Fork still shares the underlying file description.=C2=A0 It only duplicat= es > the descriptors.=C2=A0 If the subprocess changes the file pointer back to= 0, > it will affect the original process, too.=C2=A0 This is just how file > descriptors work. >=20 > Could this explain the issue? That does sound like what the symptoms would indicate. However it doesn't seem to fit, because the first thing the child process does is call freopen(), which should in theory close the descriptor and then create a new file descriptor and file description? On the other hand, the fact that using fclose()+fopen() instead of freopen() does seem to fix the problem, seems to indicate that freopen() is not actually successfully closing the descriptor and thus the file pointer is shared between processes? --=20 bye, pabs https://bonedaddy.net/pabs3/ --=-L1+GkxspVgt0rWFZt1uB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEYQsotVz8/kXqG1Y7MRa6Xp/6aaMFAmN+tYsACgkQMRa6Xp/6 aaMr/BAAr/2C+Q/UWaH79ZBgyB1CbxeLGcgt7eHLnpLcaGhm5FtTdXUFSnemQCH5 LuXpK9lw3bUje0TprxkVfpDmuEmS05i6rQEqTWJX5IZmC6iEI1ggIy/tYfWz/pWd 61kpzqufLZHbtb5DcBd+9R3kz1YR9wcSdQqt0fuG8CkwNZVmNF0AJtqAk34MYaQh rlX/73GaXGt6nRAQzDFc1aA0uferYnAeoEap6OeDYd8/otSPzFDGPUmujXFJ6D1O SvScXlYLPn0MGDvq1WrbzSNrHqm6uJdCzx7eka2EACEcTJf5V+6AHO1ASLxmog4r gyTmEnB/puFJE/daS1P8B8+kMd3E5e98sXzDia3G0X2LVTpTPuD06umtmFVWay/U 29PqP+0Tz9lHl5CFlFekCuL96K/j18pC6Wm5JC/VDj8wlCO26eS48WaZ28/eOoqK 7RcWEB5wqG81wVWvhJ9CJC3eaiiPiSp70dsINm0cDVriP37hLh4aLd1ixxXRdNRs 3EAxRd6bRJ2gwy/XySj+Ta8UaV9GoTDHpYhtNTF7bTlaODBqpl5TGpiJldGaSuRV m3VHAEnPPS5o7xm/s+I3Y60Nf8ByZdAkOdyUm+ZRvoDr7bjPqhZ04Xj3wz961VId w+EJDXLonUl5hByN7fb+duFhInl5zWqw50i6Uv2CTfxq0qgQ6rQ= =vkYl -----END PGP SIGNATURE----- --=-L1+GkxspVgt0rWFZt1uB--