Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASAN][upstream][25][clang]javaClasses.cpp:427:10: runtime error: call to function JNU_NewStringPlatform through pointer to incorrect function type '_jstring *(*)(JNIEnv_ *, const char *)' #153

Open
sendaoYan opened this issue Dec 25, 2024 · 0 comments
Assignees

Comments

@sendaoYan
Copy link
Collaborator

Configure command:

export PATH=~/software/acc/`arch`/bin:$PATH ; export LD_LIBRARY_PATH=~/software/acc/`arch`/lib64/clang/17/lib/linux:$LD_LIBRARY_PATH ; export CFLAGS="-shared-libasan" ; export CXXFLAGS=$CFLAGS ; export LDFLAGS=$CFLAGS ; export "CUSTOM_CONFIG=--enable-asan --enable-ubsan --enable-lsan --with-toolchain-type=clang --with-toolchain-path=~/software/acc/`arch`/bin" && export ASAN_OPTIONS="detect_leaks=0,abort_on_error=0,verbosity=3" && export LSAN_OPTIONS=suppressions=$HOME/tone/tone-matrix-compiler/jtreg/asan/leak-suppressions.txt && export UBSAN_OPTIONS="suppressions=$HOME/tone/tone-matrix-compiler/jtreg/asan/suppressions-UndefinedBehavior-clang.txt,print_stacktrace=1"
bash configure --with-jobs=128 --prefix=/home/yansendao/git/jdk-asan-clang/install-fastdebug --verbose --with-debug-level=fastdebug --enable-unlimited-crypto --with-vendor-name=yansendao --with-vendor-url=https://github.com/sendaoYan --with-vendor-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-vendor-vm-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-jvm-variants=server --with-boot-jdk=/home/yansendao/software/jdk/24/jdk-repo-binary --with-gtest=/home/yansendao/git/googletest-v1.14.x --with-jtreg=/home/yansendao/software/jdk/jtreg-7.4 --with-jmh=build/jmh/jars    --with-version-opt=23d6f747 --with-zlib=system --enable-ccache --with-native-debug-symbols=external --with-extra-cflags=-shared-libasan --with-extra-cxxflags=-shared-libasan --with-extra-ldflags=-shared-libasan  --enable-asan --enable-ubsan --enable-lsan --with-toolchain-type=clang --with-toolchain-path=~/software/acc/x86_64/bin

Standalone command:

/home/yansendao/git/jdk-asan-clang/build/linux-x86_64-server-fastdebug/jdk/bin/javac -J-Djava.io.tmpdir=/home/yansendao/git/jdk-asan-clang/build/linux-x86_64-server-fastdebug/support/javatmp -g -Xlint:all -source 25 -target 25 -implicit:none -Xprefer:source -XDignore.symbol.file=true -encoding ascii -Werror --add-modules jdk.compiler,jdk.jdeps --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED --add-exports jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED -Xlint:-options -XDmodifiedInputs=/home/yansendao/git/jdk-asan-clang/build/linux-x86_64-server-fastdebug/buildtools/create_symbols_javac/_the.COMPILE_CREATE_SYMBOLS_batch.modfiles.fixed -d /home/yansendao/git/jdk-asan-clang/build/linux-x86_64-server-fastdebug/buildtools/create_symbols_javac @/home/yansendao/git/jdk-asan-clang/build/linux-x86_64-server-fastdebug/buildtools/create_symbols_javac/_the.COMPILE_CREATE_SYMBOLS_batch.filelist

result:

src/hotspot/share/classfile/javaClasses.cpp:427:10: runtime error: call to function JNU_NewStringPlatform through pointer to incorrect function type '_jstring *(*)(JNIEnv_ *, const char *)'
/home/yansendao/git/jdk-asan-clang/src/java.base/share/native/libjava/jni_util.c:821: note: JNU_NewStringPlatform defined here
    #0 0x7f61cd322d54 in java_lang_String::create_from_platform_dependent_str(char const*, JavaThread*) /home/yansendao/git/jdk-asan-clang/src/hotspot/share/classfile/javaClasses.cpp:427:10
    #1 0x7f61cd777807 in JVM_GetProperties /home/yansendao/git/jdk-asan-clang/src/hotspot/share/prims/jvm.cpp:338:29
    #2 0x7f61bde95d44  (<unknown module>)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/hotspot/share/classfile/javaClasses.cpp:427:10 in

configure-command.txt
configure-linux-x86_64-server-fastdebug.log
make-linux-x86_64-server-fastdebug-2.log
buildtools_create_symbols_javac__the.COMPILE_CREATE_SYMBOLS_batch.cmdline.log
make-linux-x86_64-server-fastdebug-1.log.zip

@sendaoYan sendaoYan self-assigned this Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant