https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79096
Bug ID: 79096 Summary: address sanitizer and jni does not work Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: physiker at toast2 dot net CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org Target Milestone: --- Created attachment 40521 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40521&action=edit example code address sanitizer and jni does not work I utilize the address sanitizer to detect errors in shared libraries. When I try to interface a shared library with java via jni the address sanitizer does no longer work. This has been working with gcc versions 5, 6 and earlier versions of gcc 7. While running the file make.sh (included in the attachment) the error message is: ==2099==ERROR: Interceptors are not working. This may be because AddressSanitizer is loaded too late (e.g. via dlopen). Please launch the executable with: DYLD_INSERT_LIBRARIES=/usr/local/lib/libasan.4.dylib "interceptors not installed" && 0./make.sh: line 7: 2099 Abort trap: 6 DYLD_INSERT_LIBRARIES=/usr/local/lib/libasan.4.dylib java Tasan Setting DYLD_INSERT_LIBRARIES as suggested (see the file make.sh) does not make a difference. gcc-7 -v Es werden eingebaute Spezifikationen verwendet. COLLECT_GCC=gcc-7 COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin15.6.0/7.0.0/lto-wrapper Ziel: x86_64-apple-darwin15.6.0 Konfiguriert mit: ../gcc/configure --enable-languages=c,c++,fortran,lto --with-gmp=/sw --with-libiconv-prefix=/sw --with-isl=/sw --with-mpc=/sw --with-system-zlib --program-suffix=-7 Thread-Modell: posix gcc-Version 7.0.0 20170114 (experimental) [trunk revision 244467] (GCC) java -version java version "1.8.0_112" Java(TM) SE Runtime Environment (build 1.8.0_112-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)