From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 8755F3854174 for ; Mon, 31 Oct 2022 14:02:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8755F3854174 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-13bd2aea61bso13605551fac.0 for ; Mon, 31 Oct 2022 07:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7yDfb87c6KIaEY6MkqlSvwO5cR5abXcQ0tsHm6N6gZE=; b=m53BtLqi6cDRTFh+7sjH22rypOzRHpo9KuciVuulVmfsSdLn2hjysg0UCbDb2BRsZe Os15rZodOTJK4bMEvmdGSTAlPyUWB3gY/1H4+u79AL0gtdtn7Qk3J/a8VCGyyXcS+5wy dOSi2mR2POvocZ8prRgG/9Lhttle4bqCx9Wv6QSl88UdcgnLQg5U0rkoGY47l4snaXxZ 10kIfHpDhlZVJjGb9rSymRt3buKKIk0g6X/0bZsG/z+lsDpZqmQJ/qLtadlfu7onhu+e g4/NM+wq8/AKkju8IRNu2pLj3YumYp+gSx1Vbsc0qNRNBiZYUpg/2dRL99xn2M3d3U4o mVyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7yDfb87c6KIaEY6MkqlSvwO5cR5abXcQ0tsHm6N6gZE=; b=3sIDNAYC7bw6yFMYcbKo6L08cVm4WggtPGni6n5ln3d/PK2tenvw0+FDYqh3vCHL9w oHInjXDz7JKqytlMgLZuNV0+U2thSIXHWlliddhWlyxJq2Vuxxx2XwPEcBH4cjP+Kcag jjw/ypDYHqK3JOroOPfciqMuJ2dTpnZS1/NvuL9Tbju2C5THXsZDZyMmA+GSmw1vFTFA uhjV0vFgkizOy6bk2eINV7hd2Xj5rrMdB6P35/QuISoOG+Cv9jL3adUMBIpB0kRbex7K auvr8JvWV6lFSMS7GNo3ix8xK39FP7694h34+Z/MnRjMlgsafnnduuyk13XvycQR8TGN GLYw== X-Gm-Message-State: ACrzQf1QnIk/G4qdpF76t1biLUEMQsGNv5hxIp+X8zOQD40zJDgY9EC3 Z+qFz3ZB7gOvG0d9myODKqXpNOBmBAwFOIFE X-Google-Smtp-Source: AMsMyM5KCgfYcoBGJjpH8eX2ztLuAyY0Kk4Fs31byYFK61bZyYJGKoF4Amn/HGAqNmrAmd012lNXnw== X-Received: by 2002:a05:6870:5894:b0:131:b25b:413e with SMTP id be20-20020a056870589400b00131b25b413emr17202505oab.192.1667224956856; Mon, 31 Oct 2022 07:02:36 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:17c8:29c8:c66:a795:b2b1? ([2804:1b3:a7c0:17c8:29c8:c66:a795:b2b1]) by smtp.gmail.com with ESMTPSA id c62-20020a4a4f41000000b0047f94375092sm2375513oob.40.2022.10.31.07.02.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Oct 2022 07:02:36 -0700 (PDT) Message-ID: <0958e8e6-4bef-1353-5f98-1037f04a8217@linaro.org> Date: Mon, 31 Oct 2022 11:02:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH] time: Skip overflow itimer tests on 32-bit systems Content-Language: en-US To: Stafford Horne , Alistair Francis , GLIBC patches References: <20210607131851.4015661-1-shorne@gmail.com> <8ad55354-5d41-eaa4-6d6c-e650ea30d7cc@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: On 28/10/22 16:47, Aurelien Jarno wrote: > On 2021-07-06 16:58, Adhemerval Zanella via Libc-alpha wrote: >>> diff --git a/include/time.h b/include/time.h >>> index 4372bfbd96..377a4a45ea 100644 >>> --- a/include/time.h >>> +++ b/include/time.h >>> @@ -342,6 +342,14 @@ in_time_t_range (__time64_t t) >>> return s == t; >>> } >>> >>> +/* Check whether T fits in a timeval32 (__int32_t). */ >>> +static inline bool >>> +in_timeval32_range (__time64_t t) >>> +{ >>> + __int32_t s = t; >>> + return s == t; >>> +} >>> + >> >> The name is confusing, it is mixing timeval from 'struct timeval' and >> time_t. And there is no need to use __int32_t, we need to use it only >> on installed headers to avoid namespace pollution. >> >> I fact I think it would be better to just change 'in_time_t_range' to >> use int32_t internally instead of time_t; I am pretty sure that all >> usages assume that sizeof(time_t) == 32. > > Unfortunately this is not correct. MIPS N64 uses a 64-bit time_t, > however it does not define XSTAT_IS_XSTAT64. Therefore fstatat is > different than fstatat64, and uses the default > sysdeps/unix/sysv/linux/fstatat.c implementation, which uses > in_time_t_range() with a 64-bit time_t. > > Therefore this change broke y2038 support in fstat/fstatat/lstat on MIPS > N64, which now returns EOVERFLOW for files which need such support. I > have opened BZ #29730. I think the issue in fact is XSTAT_IS_XSTAT64 is not a correct macro to define whether non-LFS and LFS symbols aliases. It is used on both old compat code (__xstat*) and on kernel syscall wrapper to define whether the kernel struct needs to be adjusted to glibc exported layout. In fact a better solution would be to add a new define, STAT_IS_STAT64, and define it 1 to both sparc64 and mips64. It would both mips64 and sparc64 alias non-LFS to LFS, making it both avoid memory copies between struct stat and struct stat64 (since for both ABI there essentially the same layout) and avoid the time_t range check (which should be used solely for compatibility code.