On Tue, Jul 14, 2020 at 02:32:57PM +0200, Rainer Orth wrote:
> The latest Solaris 11.4/x86 update uncovered a libsanitizer bug that
> caused one test to FAIL for 32-bit:
> 
> +FAIL: c-c++-common/asan/null-deref-1.c   -O0  output pattern test
> +FAIL: c-c++-common/asan/null-deref-1.c   -O1  output pattern test
> +FAIL: c-c++-common/asan/null-deref-1.c   -O2  output pattern test
> +FAIL: c-c++-common/asan/null-deref-1.c   -O2 -flto  output pattern test
> +FAIL: c-c++-common/asan/null-deref-1.c   -O2 -flto -flto-partition=none  
> output pattern test
> +FAIL: c-c++-common/asan/null-deref-1.c   -O3 -g  output pattern test
> +FAIL: c-c++-common/asan/null-deref-1.c   -Os  output pattern test
> 
> I've identified the problem and the fix has just landed in upstream
> llvm-project:
> 
>       https://reviews.llvm.org/D83664
> 
> Tested on i386-pc-solaris2.11 on master, gcc-10 and gcc-9 branches.
> 
> Ok for all three?

Won't this break i386-linux?
I mean, while the ifndef/define change is guarded by #if SANITIZER_SOLARIS,
the last changed line is not.  I'm afraid I don't know if
ucontext->uc_mcontext.gregs[REG_UESP] or ucontext->uc_mcontext.gregs[REG_ESP];
is what we want to use on i686-linux...
Similarly netbsd.

> --- a/libsanitizer/sanitizer_common/sanitizer_linux.cpp
> +++ b/libsanitizer/sanitizer_common/sanitizer_linux.cpp
> @@ -2043,13 +2043,13 @@ static void GetPcSpBp(void *context, upt
>  # ifndef REG_EBP
>  #  define REG_EBP  6 // REG_FP
>  # endif
> -# ifndef REG_ESP
> -#  define REG_ESP 17 // REG_SP
> +# ifndef REG_UESP
> +#  define REG_UESP 17 // REG_SP
>  # endif
>  # endif
>    *pc = ucontext->uc_mcontext.gregs[REG_EIP];
>    *bp = ucontext->uc_mcontext.gregs[REG_EBP];
> -  *sp = ucontext->uc_mcontext.gregs[REG_ESP];
> +  *sp = ucontext->uc_mcontext.gregs[REG_UESP];
>  # endif
>  #elif defined(__powerpc__) || defined(__powerpc64__)
>    ucontext_t *ucontext = (ucontext_t*)context;


        Jakub

Reply via email to