From nobody Sun May 15 17:31:39 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7A9141AE070D for ; Sun, 15 May 2022 17:31:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L1Tvw3Smwz3nNS for ; Sun, 15 May 2022 17:31:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vs1-xe30.google.com with SMTP id v139so13389547vsv.0 for ; Sun, 15 May 2022 10:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lnXwgwdT630XeTbo7M43ilF7/ZaDkX0WhmmwjM+tcU0=; b=Wh7A6Bhh9+ppyq0JX+01wDN10o6+sgefavmRuu2Bxa+u9FIMN1RTIQZECrJTKjX9TL j3ib5m7r9iX+b/GCuQx1rgTxHPHhunsNU+JttPrKN5jZYqejae8sGOMLG81XhM0A6YdC HsIOdQ+1UJMbhBWSIN4T7eFXmhqnN9ALoP+FMKhyTJ8dgr/R/GY6MwTqg5Hy6y9BMRus ML9QGxdCkB6CtW9+narEK3U8C/4Sk9SI7VDJJzPi0HOI+V84Rz6vVuWrOduFUyIEM/L9 LxdzESvmXam7Km7J5QSU3WFNr/pmE6z3FDM9t3zxUKZXVpsR8qE+TRZNz6hKSQvPhxoM prTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lnXwgwdT630XeTbo7M43ilF7/ZaDkX0WhmmwjM+tcU0=; b=dWng00299ArWPJvFKo3fkf/J8sxsYgZ060PwPVvhNz22hCzhLeXX655bJPnj6lGdCc X1tt1ND1RqA4YS7WTJvjpWGX5z5EMgdB/UrupXGcGqNpI0iVHoU/YpoP7lDfBQKZCFjN Na0Ohi+WOcftPAxvRtPiguhesh9e/uMN5RMGCTOCqiY0c+ZsgAYW8alL+aynY7nQeAqL pUct1uFmiTYGUFdTWttiKKkgr0qt9QV0DxnCHC4AETuyCw3a9qRNl9p8WY6CV6na7AzH t+VCQ4bSv+3iVkRNq5vsIFAK157MUPfQsXovv8ehulVoZE9XJAhePsKOHW3wi9OYZ1q+ CESg== X-Gm-Message-State: AOAM533Uf/IeefiA97I4tCIQ3XI+dbDwyf0ykGURYWY0ZMqM5Fo+3CE1 aKA7uTMt8WYS1+y8iMGz5xtSpfiJtc5bxXW/UgySAQ== X-Google-Smtp-Source: ABdhPJyS+oKvqBC7PR9ty7w19JLs59k3yVuAk06S+la9w4kSVNnnw3PR+lk17a07vRdWLLErN1Heccl6fJ9U1B6R+Cc= X-Received: by 2002:a67:f445:0:b0:32c:c32c:c7c1 with SMTP id r5-20020a67f445000000b0032cc32cc7c1mr4771460vsn.51.1652635910371; Sun, 15 May 2022 10:31:50 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Sun, 15 May 2022 11:31:39 -0600 Message-ID: Subject: Re: Changes to stat ABI To: Paul Floyd Cc: FreeBSD Hackers Content-Type: multipart/alternative; boundary="000000000000618e7505df104873" X-Rspamd-Queue-Id: 4L1Tvw3Smwz3nNS X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=Wh7A6Bhh; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::e30) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e30:from]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MLMMJ_DEST(0.00)[freebsd-hackers]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --000000000000618e7505df104873 Content-Type: text/plain; charset="UTF-8" Scratch that, this is a clang 11 vs clang13 issue. Most likely clang 13 is more aggressively optimizing, so fstat is not actually on the stack... Because of LTO, you'll need to check the disassembled binary to know for sure. Warner On Sun, May 15, 2022 at 11:30 AM Warner Losh wrote: > ino64 has gone into the tree. The stat structure layout > changed. 69921123490b99c2588b0c743bc4af32bbe6601c went into the tree a > while ago, but maybe recently enough to mess this up. > > Author: Konstantin Belousov > Date: Tue May 23 09:29:05 2017 +0000 > > Commit the 64-bit inode project. > > Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modify > struct dirent layout to add d_off, increase the size of d_fileno > to 64-bits, increase the size of d_namlen to 16-bits, and change > the required alignment. Increase struct statfs f_mntfromname[] and > f_mntonname[] array length MNAMELEN to 1024. > > On Sat, May 14, 2022 at 2:10 PM Paul Floyd wrote: > >> Hi >> >> >> Has anything changed in the way that the libc functions in the stat >> family are compiled on FreeBSD 13.1 amd64 with clang 13? >> >> >> I'm getting a few Valgrind regression test failures related to this: >> >> FreeBSD 13 / clang 11 >> >> ==84746== Syscall param fstatat(flag) contains uninitialised byte(s) >> ==84746== at 0x49942EA: ??? (in /lib/libc.so.7) >> ==84746== by 0x499018B: fstatat (in /lib/libc.so.7) >> ==84746== by 0x201E7D: main (stat.c:67) >> >> FreeBSD 13.1 / clang 13 >> >> ==57383== Syscall param fstatat(flag) contains uninitialised byte(s) >> ==57383== at 0x499239A: ??? (in /lib/libc.so.7) >> ==57383== by 0x201E57: main (stat.c:67) >> >> A+ >> >> Paul >> >> >> >> --000000000000618e7505df104873 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Scratch that, this is a clang 11 vs clang13 issue.
Most likely clang 13 is more aggressively=C2=A0optimizing, so f= stat is not actually on the stack... Because
of LTO, you'll n= eed to check the disassembled binary to know for sure.

=
Warner

On Sun, May 15, 2022 at 11:30 AM Warner Losh <imp@bsdimp.com> wrote:
ino64 has gone in= to the tree. The stat structure layout changed.=C2=A069921123490b99c2588b0c= 743bc4af32bbe6601c went into the tree a while ago, but maybe recently enoug= h to mess this up.

Author: Konstantin Belousov <kib@F= reeBSD.org>
Date: =C2=A0 Tue May 23 09:29:05 2017 +0000

=C2=A0= =C2=A0 Commit the 64-bit inode project.

=C2=A0 =C2=A0 Extend the in= o_t, dev_t, nlink_t types to 64-bit ints.=C2=A0 Modify
=C2=A0 =C2=A0 str= uct dirent layout to add d_off, increase the size of d_fileno
=C2=A0 =C2= =A0 to 64-bits, increase the size of d_namlen to 16-bits, and change
=C2= =A0 =C2=A0 the required alignment.=C2=A0 Increase struct statfs f_mntfromna= me[] and
=C2=A0 =C2=A0 f_mntonname[] array length MNAMELEN to 1024.
<= /div>

On Sat, May 14, 2022 at 2:10 PM Paul Floyd <paulf2718@gmail.com> wrote:
Hi


Has anything changed in the way that the libc functions in the stat
family are compiled on FreeBSD 13.1 amd64 with clang 13?


I'm getting a few Valgrind regression test failures related to this:
FreeBSD 13 / clang 11

=3D=3D84746=3D=3D Syscall param fstatat(flag) contains uninitialised byte(s= )
=3D=3D84746=3D=3D=C2=A0=C2=A0=C2=A0 at 0x49942EA: ??? (in /lib/libc.so.7) =3D=3D84746=3D=3D=C2=A0=C2=A0=C2=A0 by 0x499018B: fstatat (in /lib/libc.so.= 7)
=3D=3D84746=3D=3D=C2=A0=C2=A0=C2=A0 by 0x201E7D: main (stat.c:67)

FreeBSD 13.1 / clang 13

=3D=3D57383=3D=3D Syscall param fstatat(flag) contains uninitialised byte(s= )
=3D=3D57383=3D=3D=C2=A0=C2=A0=C2=A0 at 0x499239A: ??? (in /lib/libc.so.7) =3D=3D57383=3D=3D=C2=A0=C2=A0=C2=A0 by 0x201E57: main (stat.c:67)

A+

Paul



--000000000000618e7505df104873--