Configure command:
bash configure --prefix=/home/yansendao/git/jdk-ysd/install-fastdebug --verbose --with-debug-level=fastdebug --with-gtest=/home/yansendao/git/googletest-v1.14.x --with-jtreg=/home/yansendao/software/jdk/jtreg-7.4 --with-zlib=system --enable-ccache --with-native-debug-symbols=external --enable-asan --enable-ubsan --enable-lsan --with-toolchain-type=clang
Make command:
time make images test-image CONF=linux-x86_64-server-fastdebug &> build/make-fastdebug.log
Test command:
build/linux-x86_64-server-fastdebug/images/test/hotspot/gtest/server/gtestLauncher -jdk build/linux-x86_64-server-fastdebug/images/jdk --gtest_output=xml:test_result.xml --gtest_catch_exceptions=0 --gtest_filter=NMTNativeCallStackStorageTest.CollisionsReceiveDifferentIndexes_vm -XX:NativeMemoryTracking=detail
result:
=================================================================
==2619005==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffff82c0 at pc 0x7ffff22dff77 bp 0x7fffffff7f10 sp 0x7fffffff7f08
READ of size 8 at 0x7fffffff82c0 thread T0
#0 0x7ffff22dff76 in NativeCallStack::NativeCallStack(unsigned char**, int) /home/yansendao/git/jdk-ysd/src/hotspot/share/utilities/nativeCallStack.cpp:55:21
#1 0x7fffee141df8 in NMTNativeCallStackStorageTest_CollisionsReceiveDifferentIndexes_vm_Test::TestBody() /home/yansendao/git/jdk-ysd/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp:46:18
#2 0x7ffff3ad79be in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2670:12
#3 0x7ffff3a57eae in testing::Test::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2687:5
#4 0x7ffff3a59cbc in testing::TestInfo::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2836:11
#5 0x7ffff3a5b898 in testing::TestSuite::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:3015:30
#6 0x7ffff3a7c7a0 in testing::internal::UnitTestImpl::RunAllTests() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:5920:44
#7 0x7ffff3adea47 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2670:12
#8 0x7ffff3a7b651 in testing::UnitTest::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:5484:10
#9 0x7fffeda2db6b in RUN_ALL_TESTS() /home/yansendao/git/googletest-v1.14.x/googletest/include/gtest/gtest.h:2317:73
#10 0x7fffeda2b1ae in runUnitTestsInner(int, char**) /home/yansendao/git/jdk-ysd/test/hotspot/gtest/gtestMain.cpp:290:16
#11 0x7fffeda2b44e in runUnitTests /home/yansendao/git/jdk-ysd/test/hotspot/gtest/gtestMain.cpp:371:5
#12 0x204350 in main /home/yansendao/git/jdk-ysd/test/hotspot/gtest/gtestLauncher.cpp:40:3
#13 0x7fffe6b1ca71 in __libc_start_main (/lib64/libc.so.6+0x3ea71) (BuildId: 3308b7b1df603240fd3f43dd895bcb2ad87e7eb9)
#14 0x202e7d in _start (/home/yansendao/git/jdk-ysd/build/linux-x86_64-server-slowdebug/images/test/hotspot/gtest/server/gtestLauncher+0x202e7d)
Address 0x7fffffff82c0 is located in stack of thread T0 at offset 416 in frame
#0 0x7fffee1419ff in NMTNativeCallStackStorageTest_CollisionsReceiveDifferentIndexes_vm_Test::TestBody() /home/yansendao/git/jdk-ysd/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp:42
This frame has 10 object(s):
[32, 352) 'ncs_arr' (line 44)
[416, 420) 'i' (line 45) <== Memory access at offset 416 partially overflows this variable
[432, 464) 'ref.tmp' (line 46)
[496, 640) 'ncss' (line 49)
[704, 744) 'si_arr' (line 50)
[784, 800) 'gtest_ar_' (line 59)
[816, 817) 'ref.tmp42' (line 59)
[832, 840) 'ref.tmp62' (line 59)
[864, 872) 'ref.tmp63' (line 59)
[896, 928) 'ref.tmp64' (line 59)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/yansendao/git/jdk-ysd/src/hotspot/share/utilities/nativeCallStack.cpp:55:21 in NativeCallStack::NativeCallStack(unsigned char**, int)
Shadow bytes around the buggy address:
0x7fffffff8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fffffff8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fffffff8100: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00
0x7fffffff8180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fffffff8200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x7fffffff8280: f2 f2 f2 f2 f2 f2 f2 f2[04]f2 00 00 00 00 f2 f2
0x7fffffff8300: f2 f2 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
0x7fffffff8380: f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2 f2 f8 f8 f8 f8
0x7fffffff8400: f8 f2 f2 f2 f2 f2 f8 f8 f2 f2 f8 f2 f8 f2 f2 f2
0x7fffffff8480: f8 f2 f2 f2 f8 f8 f8 f8 f3 f3 f3 f3 00 00 00 00
0x7fffffff8500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==2619005==ABORTING
bash configure --prefix=/home/yansendao/git/jdk-ysd/install-fastdebug --verbose --with-debug-level=fastdebug --with-gtest=/home/yansendao/git/googletest-v1.14.x --with-jtreg=/home/yansendao/software/jdk/jtreg-7.4 --with-zlib=system --enable-ccache --with-native-debug-symbols=external --enable-asan --enable-ubsan --enable-lsan --with-toolchain-type=clang
Make command:
time make images test-image CONF=linux-x86_64-server-fastdebug &> build/make-fastdebug.log
Test command:
build/linux-x86_64-server-fastdebug/images/test/hotspot/gtest/server/gtestLauncher -jdk build/linux-x86_64-server-fastdebug/images/jdk --gtest_output=xml:test_result.xml --gtest_catch_exceptions=0 --gtest_filter=NMTNativeCallStackStorageTest.CollisionsReceiveDifferentIndexes_vm -XX:NativeMemoryTracking=detail
result:
=================================================================
==2619005==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffff82c0 at pc 0x7ffff22dff77 bp 0x7fffffff7f10 sp 0x7fffffff7f08
READ of size 8 at 0x7fffffff82c0 thread T0
#0 0x7ffff22dff76 in NativeCallStack::NativeCallStack(unsigned char**, int) /home/yansendao/git/jdk-ysd/src/hotspot/share/utilities/nativeCallStack.cpp:55:21
#1 0x7fffee141df8 in NMTNativeCallStackStorageTest_CollisionsReceiveDifferentIndexes_vm_Test::TestBody() /home/yansendao/git/jdk-ysd/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp:46:18
#2 0x7ffff3ad79be in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2670:12
#3 0x7ffff3a57eae in testing::Test::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2687:5
#4 0x7ffff3a59cbc in testing::TestInfo::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2836:11
#5 0x7ffff3a5b898 in testing::TestSuite::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:3015:30
#6 0x7ffff3a7c7a0 in testing::internal::UnitTestImpl::RunAllTests() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:5920:44
#7 0x7ffff3adea47 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:2670:12
#8 0x7ffff3a7b651 in testing::UnitTest::Run() /home/yansendao/git/googletest-v1.14.x/googletest/src/gtest.cc:5484:10
#9 0x7fffeda2db6b in RUN_ALL_TESTS() /home/yansendao/git/googletest-v1.14.x/googletest/include/gtest/gtest.h:2317:73
#10 0x7fffeda2b1ae in runUnitTestsInner(int, char**) /home/yansendao/git/jdk-ysd/test/hotspot/gtest/gtestMain.cpp:290:16
#11 0x7fffeda2b44e in runUnitTests /home/yansendao/git/jdk-ysd/test/hotspot/gtest/gtestMain.cpp:371:5
#12 0x204350 in main /home/yansendao/git/jdk-ysd/test/hotspot/gtest/gtestLauncher.cpp:40:3
#13 0x7fffe6b1ca71 in __libc_start_main (/lib64/libc.so.6+0x3ea71) (BuildId: 3308b7b1df603240fd3f43dd895bcb2ad87e7eb9)
#14 0x202e7d in _start (/home/yansendao/git/jdk-ysd/build/linux-x86_64-server-slowdebug/images/test/hotspot/gtest/server/gtestLauncher+0x202e7d)
Address 0x7fffffff82c0 is located in stack of thread T0 at offset 416 in frame
#0 0x7fffee1419ff in NMTNativeCallStackStorageTest_CollisionsReceiveDifferentIndexes_vm_Test::TestBody() /home/yansendao/git/jdk-ysd/test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp:42
This frame has 10 object(s):
[32, 352) 'ncs_arr' (line 44)
[416, 420) 'i' (line 45) <== Memory access at offset 416 partially overflows this variable
[432, 464) 'ref.tmp' (line 46)
[496, 640) 'ncss' (line 49)
[704, 744) 'si_arr' (line 50)
[784, 800) 'gtest_ar_' (line 59)
[816, 817) 'ref.tmp42' (line 59)
[832, 840) 'ref.tmp62' (line 59)
[864, 872) 'ref.tmp63' (line 59)
[896, 928) 'ref.tmp64' (line 59)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
(longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/yansendao/git/jdk-ysd/src/hotspot/share/utilities/nativeCallStack.cpp:55:21 in NativeCallStack::NativeCallStack(unsigned char**, int)
Shadow bytes around the buggy address:
0x7fffffff8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fffffff8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fffffff8100: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00
0x7fffffff8180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x7fffffff8200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x7fffffff8280: f2 f2 f2 f2 f2 f2 f2 f2[04]f2 00 00 00 00 f2 f2
0x7fffffff8300: f2 f2 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
0x7fffffff8380: f8 f8 f8 f8 f2 f2 f2 f2 f2 f2 f2 f2 f8 f8 f8 f8
0x7fffffff8400: f8 f2 f2 f2 f2 f2 f8 f8 f2 f2 f8 f2 f8 f2 f2 f2
0x7fffffff8480: f8 f2 f2 f2 f8 f8 f8 f8 f3 f3 f3 f3 00 00 00 00
0x7fffffff8500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==2619005==ABORTING
- links to
-
Commit(master) openjdk/jdk/bb528d5a
-
Review(master) openjdk/jdk/23294