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][24]memory leak in CodeBuffer::CodeBuffer(unsigned char*, int) codeBuffer.hpp:531 #131

Open
sendaoYan opened this issue Nov 15, 2024 · 0 comments
Assignees

Comments

@sendaoYan
Copy link
Collaborator

sendaoYan commented Nov 15, 2024

build command:

export "CUSTOM_CONFIG=--enable-asan --enable-ubsan --enable-lsan" && export ASAN_OPTIONS="detect_leaks=1" && export LSAN_OPTIONS=suppressions=$HOME/tone/tone-matrix-compiler/jtreg/asan/leak-suppressions.txt
bash configure --with-jobs=128 --prefix=/home/yansendao/git/jdk/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=8a2a75e5 --with-zlib=system --enable-ccache --with-native-debug-symbols=external    --enable-asan --enable-ubsan --enable-lsan
time make all

java memory leak replay command:

/home/yansendao/git/jdk-ysd/build/linux-x86_64-server-fastdebug/jdk/bin/java -Xms64M -Xmx1600M -cp /home/yansendao/git/jdk-ysd/build/linux-x86_64-server-fastdebug/buildtools/tools_jigsaw_classes --add-exports java.base/jdk.internal.module=ALL-UNNAMED build.tools.jigsaw.AddPackagesAttribute /home/yansendao/git/jdk-ysd/build/linux-x86_64-server-fastdebug/jdk &> java.log

result:

Direct leak of 1008 byte(s) in 24 object(s) allocated from:
    #0 0x7f01530b0667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
    #1 0x7f013b5f76c7 in os::malloc(unsigned long, MemTag, NativeCallStack const&) src/hotspot/share/runtime/os.cpp:666
    #2 0x7f01364dacea in AllocateHeap(unsigned long, MemTag, NativeCallStack const&, AllocFailStrategy::AllocFailEnum) src/hotspot/share/memory/allocation.cpp:42
    #3 0x7f01364dacea in AllocateHeap(unsigned long, MemTag, AllocFailStrategy::AllocFailEnum) src/hotspot/share/memory/allocation.cpp:52
    #4 0x7f0137c2fef0 in CHeapObjBase::operator new(unsigned long, MemTag) src/hotspot/share/memory/allocation.hpp:127
    #5 0x7f0137c2fef0 in CHeapObj<(MemTag)4>::operator new(unsigned long) src/hotspot/share/memory/allocation.hpp:181
    #6 0x7f0137c2fef0 in AsmRemarks::AsmRemarks() src/hotspot/share/asm/codeBuffer.cpp:1188
    #7 0x7f0137c2fef0 in CodeBuffer::CodeBuffer(unsigned char*, int) src/hotspot/share/asm/codeBuffer.hpp:531
    #8 0x7f0137c2fef0 in CodeBuffer::expand(CodeSection*, int) src/hotspot/share/asm/codeBuffer.cpp:902
    #9 0x7f0138a6fe34 in CodeSection::maybe_expand_to_ensure_remaining(int) src/hotspot/share/asm/codeBuffer.hpp:772
    #10 0x7f0138a6fe34 in G1BarrierSetC2::emit_stubs(CodeBuffer&) const src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp:542
    #11 0x7f013b6f48e4 in PhaseOutput::fill_buffer(C2_MacroAssembler*, unsigned int*) src/hotspot/share/opto/output.cpp:1857
    #12 0x7f013b7014f4 in PhaseOutput::Output() src/hotspot/share/opto/output.cpp:367
    #13 0x7f0137dba099 in Compile::Code_Gen() src/hotspot/share/opto/compile.cpp:3028
    #14 0x7f0137dcbdb0 in Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*) src/hotspot/share/opto/compile.cpp:885
    #15 0x7f01374af0ba in C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*) src/hotspot/share/opto/c2compiler.cpp:142
    #16 0x7f0137e05a66 in CompileBroker::invoke_compiler_on_method(CompileTask*) src/hotspot/share/compiler/compileBroker.cpp:2319
    #17 0x7f0137e09b6e in CompileBroker::compiler_thread_loop() src/hotspot/share/compiler/compileBroker.cpp:1977
    #18 0x7f013970f0ea in JavaThread::thread_main_inner() src/hotspot/share/runtime/javaThread.cpp:772
    #19 0x7f0139732633 in JavaThread::run() src/hotspot/share/runtime/javaThread.cpp:757
    #20 0x7f013cc62586 in Thread::call_run() src/hotspot/share/runtime/thread.cpp:232
    #21 0x7f013b621341 in thread_native_entry src/hotspot/os/linux/os_linux.cpp:858
    #22 0x7f0153a663fa in start_thread (/lib64/libpthread.so.0+0x93fa)

ASAN leak 已知问题屏蔽方法:
运行时配置环境变量,export LSAN_OPTIONS=suppressions=$HOME/tone/tone-matrix-compiler/jtreg/asan/leak-suppressions.txt
leak-suppressions.txt文件内容为每一行屏蔽一个函数方法 leak:函数签名,参考如下:

image

leak-suppressions.txt
make-linux-x86_64-server-fastdebug-1.log.zip
make-linux-x86_64-server-fastdebug-2.log
java.log

@sendaoYan sendaoYan changed the title [ASAN][upstream]memory leak in CodeBuffer::CodeBuffer(unsigned char*, int) codeBuffer.hpp:531 [ASAN][upstream][24]memory leak in CodeBuffer::CodeBuffer(unsigned char*, int) codeBuffer.hpp:531 Dec 7, 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

2 participants