From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by sourceware.org (Postfix) with ESMTPS id F36A73851C1F; Wed, 3 Jun 2020 12:53:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F36A73851C1F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49cTPJ0Rkdz1rtZb; Wed, 3 Jun 2020 14:53:55 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49cTPH5ZgZz1qrK9; Wed, 3 Jun 2020 14:53:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 8YsRuZ7Fa515; Wed, 3 Jun 2020 14:53:53 +0200 (CEST) X-Auth-Info: SnZwdfZWX2wx6MPRjVAkmJUyz4v57cEcvyw0RWUq/8o= Received: from jawa (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 3 Jun 2020 14:53:53 +0200 (CEST) Date: Wed, 3 Jun 2020 14:53:47 +0200 From: Lukasz Majewski To: Joseph Myers , Paul Eggert , Adhemerval Zanella Cc: Alistair Francis , Alistair Francis , GNU C Library , Siddhesh Poyarekar , Florian Weimer , Zack Weinberg , Carlos O'Donell , Andreas Schwab , Samuel Thibault , libc-help@sourceware.org Subject: [Y2038] Replacement of struct timespec with struct __timespec64 in glibc internal code Message-ID: <20200603145347.4025892b@jawa> In-Reply-To: <20200601140740.16371-1-lukma@denx.de> References: <20200601140740.16371-1-lukma@denx.de> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/h7abL3KIHi3GS/ECre5AV2q"; protocol="application/pgp-signature" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2020 12:54:01 -0000 --Sig_/h7abL3KIHi3GS/ECre5AV2q Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Dear Community, I would like to bring up one relevant Y2038 support issue - to be more specific - the conversion/replacement of struct timespec to struct __timespec64 in glibc internal code (source tree). For example - I would like to convert nptl and pthreads to be Y2038 safe. To do that the timespec_* helpers and some functions, which use futex_time64 syscall, (from 5.1+) need to use struct __timespec64.=20 The problem is with instant replacement of struct timespec with struct __timespec64 in glibc internal code (and tests).=20 To do it I could: - Replace its occurences in relevant directories - like ./nptl or ./sysdeps/pthread - i.e. rename all occurrences in a single directory =20 - Replace them in functions (tests) and use explicit conversion functions - like valid_timespec_to_timespec64() before passing struct __timespec64 arguments (like ones for futex_time64 for nptl). - Replace _all_ occurrences in glibc tree of struct timespec with struct __timespec64 at once with using sed on the glibc tree. The last option seems to be the most appealing as we already use __timespec64 (with its aliasing) for some core system syscalls (like clock_gettime).=20 However, such patch shall be applied just after the release of new stable glibc version (August 2020?) to have time for potential fixes. Which options shall we use? A few more related questions: - Shall tests in ./nptl and ./sysdeps/pthread [*] use struct __timespec64 or struct timespec?=20 From my understanding tests (like ./nptl/tst-*) use exported headers so struct timespec for them is struct __timespec64 anyway for archs with __WORDSIZE =3D=3D 32 and __TIMESIZE !=3D64. - Other time related structures needs to be converted as well - like struct itimerspec.=20 [*] - from running scripts/build-many-glibcs.py it looks like only i686-gnu port (HURD) is using code in ./sysdeps/pthread. Will ./sysdeps/pthread be replaced by nptl in some near time in the future (and removed)?=20 Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/h7abL3KIHi3GS/ECre5AV2q Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl7XnVsACgkQAR8vZIA0 zr2Uvgf/XkSo+1B7z8Mrc/JDlZPpdp12441IiGTAAEPyWm1sDFPJGj1MFhMlUlhG 6kRoqEHqOM0wzpPRk2cPk1vLVB0/sPghPpq851jnQNt91pUkD3ps4k4DFu6frqyn fWruwsYZ/MzbjO3WZIqr5slgZqiPaE7ks2HoC6nvcdYn3KbDO6mCKTSSQCOo19un evMCtwpsessfORFu0tkPj3SgCLXoxSoTO4bqBJsCd3Rfadaj8WBWzjJalhneIM5X pXOemoEfimCnTByvD3iyUOCBO7b4P2dfPfPixm/YMIezmp2jFvQA5EQxXW/bPT7I 0lMpdfWULAJh71EhZU3ZIPUI7HMyfg== =VyAI -----END PGP SIGNATURE----- --Sig_/h7abL3KIHi3GS/ECre5AV2q--