diff options
author | Rainer Orth <ro@gcc.gnu.org> | 2020-09-30 16:30:18 +0200 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2020-09-30 16:30:18 +0200 |
commit | dc261d23d07cccfa7b10a3d1a43903138aee94dc (patch) | |
tree | ee61039717d42f410b0a7970dcda8c28853abd0f /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | f33f8a2b30325d89c4b7daef1b7d11d6da38fd56 (diff) | |
download | llvm-dc261d23d07cccfa7b10a3d1a43903138aee94dc.zip llvm-dc261d23d07cccfa7b10a3d1a43903138aee94dc.tar.gz llvm-dc261d23d07cccfa7b10a3d1a43903138aee94dc.tar.bz2 |
[sanitizers] Fix internal__exit on Solaris
`TestCases/log-path_test.cpp` currently `FAIL`s on Solaris:
$ env ASAN_OPTIONS=log_path=`for((i=0;i<10000;i++)); do echo -n $i; done` ./log-path_test.cpp.tmp
==5031==ERROR: Path is too long: 01234567...
Segmentation Fault (core dumped)
The `SEGV` happens here:
Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x00000000 in ?? ()
(gdb) where
#0 0x00000000 in ?? ()
#1 0x080a1e63 in __interceptor__exit (status=1)
at /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:3808
#2 0x08135ea8 in __sanitizer::internal__exit (exitcode=1)
at /vol/gcc/src/llvm/llvm/local/projects/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cc:139
when `__interceptor__exit` tries to call `__interception::real__exit` which
is `NULL` at this point because the interceptors haven't been initialized yet.
Ultimately, the problem lies elsewhere, however: `internal__exit` in
`sanitizer_solaris.cpp` calls `_exit` itself since there doesn't exit a
non-intercepted version in `libc`. Using the `syscall` interface instead
isn't usually an option on Solaris because that interface isn't stable.
However, in the case of `SYS_exit` it can be used nonetheless: `SYS_exit`
has remained unchanged since at least Solaris 2.5.1 in 1996, and this is
what this patch does.
Tested on `amd64-pc-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D88404
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions