Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2022 09:59:29 +0200
From:      "Floyd, Paul" <paulf2718@gmail.com>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Changes to stat ABI
Message-ID:  <8771f132-7388-29b6-313b-62b92869002d@gmail.com>
In-Reply-To: <CANCZdfpshqwM_XvE6BUDhi48gwe2475PZG_9ZxGT2yu_611=RQ@mail.gmail.com>
References:  <cd9ef009-47aa-acc7-509e-7afca9b24a84@gmail.com> <CANCZdfqtS5_bzj-4Q0ERJ=qar==NWURke5O6STkhyVHepD5krg@mail.gmail.com> <CANCZdfpshqwM_XvE6BUDhi48gwe2475PZG_9ZxGT2yu_611=RQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 2022-05-15 19:31, Warner Losh wrote:
> 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.
>

Hi Warner

I'll do some tests on varions combinations of FreeBSD 13 / 13.1 and 
clang 11 / 13. I don't understand why optimization would affect stat 
family syscalls but not any other syscalls though.

One issue is whether system calls use a function prolog or not. Prior to 
FreeBSD 13.0, Valgrind assumed no prolog and looked directly for a 
return address at the top of the stack rather than saved RBP then the 
return address. This changed in FreeBSD 13.0. Actually I didn't see 
exactly what had changed in FreeBSD, but disabling the 
syscall-with-no-prolog check fixed a lot of test failures. It's also 
possible that the code that looks for CFI didn't work prior to FreeBSD 13.0.

I'll also do some tests on Valgrind so see if the no-prolog code is 
causing this.

A+

Paul




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8771f132-7388-29b6-313b-62b92869002d>