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.9]) by sourceware.org (Postfix) with ESMTPS id B306F3858006; Wed, 28 Oct 2020 10:02:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B306F3858006 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 4CLkf53GQ3z1qs1D; Wed, 28 Oct 2020 11:02:53 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CLkf52DpFz1qy5y; Wed, 28 Oct 2020 11:02:53 +0100 (CET) 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 BQqwr-CH-RcZ; Wed, 28 Oct 2020 11:02:51 +0100 (CET) X-Auth-Info: L0aDQkzWu5eM1D9ufYXRlyjgaK3XMffsuhYX/mWLNFs= 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, 28 Oct 2020 11:02:51 +0100 (CET) Date: Wed, 28 Oct 2020 11:01:56 +0100 From: Lukasz Majewski To: libc-help Cc: Carlos O'Donell , Florian Weimer , Joseph Myers , libc-alpha@sourceware.org, Adhemerval Zanella , Arnd Bergmann , Alistair Francis , Andreas Schwab Subject: [Y2038] Question about porting y2038-tests to glibc Message-ID: <20201028110156.747fb676@jawa> 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_/AqB_P6MMqenOtNvmVLPAwtR"; protocol="application/pgp-signature" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, 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-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 10:02:58 -0000 --Sig_/AqB_P6MMqenOtNvmVLPAwtR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Dear Community, I'm going to port a set of Y2038 tests [1] into the glibc test suite. The operation of porting the code to handle eligible syscalls (like clock_settime, etc.) seems to be straightforward. However, one issue is a bit problematic - namely the adjusting of time when tests run. It would be best to run tests with "current" (i.e. time not after 03:14:07 UTC 19 January 2038) and after it (when 32 bit time_t and friends overflow). Now, I do use a QEMU ARM BSP built with Yocto [2], so there is no issue to run date +s and set time manually. Also, the time can be adjusted by the test itself. As I do run it all on the QEMU the Host system is not affected in any way. Hence the question - it would be best to tie Y2038 test with all eligible 32 bit systems (arm, ppc32, mips, riscv32, etc) and run them when glibc-build-many.py is executed (as part of its check stage). Possible ideas (the IMHO best approach first): 1. Use of "faketime" [3] to execute test program. This however imposes the requirement to have it installed (by glibc-build-many as we did with binutils and compilers). Good news is that there is already a python wrapper for it [4], so maybe the time can be set for "check" stage. 2. Run tests with QEMU, but this also requires it to be installed and it may be not easily deployable. 3. Adjust host time in the tests code (via clock_settime/gettime syscalls). This is IMHO a no-op as we may end up with changed host time when test/built breaks by any reason. Or maybe somebody has better idea how to solve this issue? Thanks in advance for input. Links: [1] - https://github.com/lmajewski/y2038-tests/commits/master [2] - https://github.com/lmajewski/meta-y2038/blob/master/README [3] - http://manpages.ubuntu.com/manpages/trusty/man1/faketime.1.html [4] - https://pypi.org/project/faketime/ 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_/AqB_P6MMqenOtNvmVLPAwtR Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl+ZQZQACgkQAR8vZIA0 zr1CKQgAktgxLdu+UX0yHt74VS9gEWM54oajlDliMuphHtPu3rg21U4vZm0uw+Nq 0JCRtISyh71KPJNINRfJSHoL6Fd//QJPOfWuNQgzeam3aNQIgjiHvZiTAZOPbXuU 9xG9KSN/TulsAEe6Nq6RPBwFiDNxm98vXmd7Q3C1lXCMu8Yy0qJXWodLWv2pcrIZ 3xL4ezpM17mT9Aah+gZx/7oXlko2DYCPFB/uBD5QehJ+SHaqueoKPkzCJAb57sPY WMy8aaRQJy87jxazIUKb45uul7RnfdmEcyivsCKdDoRQIuswkAmgJPacpS6DNnoP 2ocJLYbTXZl52CubnVr5pzpCKZ8t+Q== =OXs3 -----END PGP SIGNATURE----- --Sig_/AqB_P6MMqenOtNvmVLPAwtR--