JDK-8216493 : VirtualSpaceNodeTest.half_vsn_is_committed_humongous_chunk_is_used_test_vm crashes on local machine
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: x86
  • Submitted: 2019-01-10
  • Updated: 2019-08-15
  • Resolved: 2019-01-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12 JDK 13
12.0.2Fixed 13 b06Fixed
Related Reports
Relates :  
Description
Reproduces readily on my Mac run locally via "test-hotspot-gtest"

[----------] 8 tests from VirtualSpaceNodeTest
[ RUN      ] VirtualSpaceNodeTest.sanity_test_vm
[       OK ] VirtualSpaceNodeTest.sanity_test_vm (0 ms)
[ RUN      ] VirtualSpaceNodeTest.four_pages_vsn_is_committed_some_is_used_by_chunks_test_vm
[       OK ] VirtualSpaceNodeTest.four_pages_vsn_is_committed_some_is_used_by_chunks_test_vm (0 ms)
[ RUN      ] VirtualSpaceNodeTest.half_vsn_is_committed_humongous_chunk_is_used_test_vm
assert failed: list invariant

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/Volumes/Work/bugs/8215155/jdk13/open/src/hotspot/share/memory/freeList.inline.hpp:189), pid=32065, tid=775
#  assert(head() == __null || head()->prev() == __null) failed: list invariant
#
# JRE version: Java(TM) SE Runtime Environment (13.0) (fastdebug build 13-internal+0-adhoc.gerard.open)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 13-internal+0-adhoc.gerard.open, mixed mode, tiered, compressed oops, g1 gc, bsd-amd64)
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  S U M M A R Y ------------

Command Line: -XX:+ExecutingUnitTests 

Host: Gerards-MBP-17, MacBookPro14,3 x86_64 3100 MHz, 8 cores, 16G, Darwin 18.0.0
Time: Thu Jan 10 10:55:25 2019 CST elapsed time: 16 seconds (0d 0h 0m 16s)

---------------  T H R E A D  ---------------

Current thread (0x00007fd2d2807000):  JavaThread "main" [_thread_in_native, id=775, stack(0x00007ffeebb26000,0x00007ffeefb25000)]

Stack: [0x00007ffeebb26000,0x00007ffeefb25000],  sp=0x00007ffeefb23b40,  free space=65526k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0xddcae5]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x5fd
V  [libjvm.dylib+0xddd17b]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x47
V  [libjvm.dylib+0x534eca]  report_vm_error(char const*, int, char const*, char const*, ...)+0xcc
V  [libjvm.dylib+0x4048eb]  FreeList<metaspace::Metachunk>::return_chunk_at_head(metaspace::Metachunk*, bool)+0xf5
V  [libjvm.dylib+0x401f18]  metaspace::ChunkManager::return_single_chunk(metaspace::Metachunk*)+0x2c0
V  [libjvm.dylib+0xdd405c]  metaspace::VirtualSpaceNode::allocate_padding_chunks_until_top_is_at(MetaWord*)+0x3e4
V  [libjvm.dylib+0xdd42dc]  metaspace::VirtualSpaceNode::take_from_committed(unsigned long)+0x20a
V  [libjvm.dylib+0xdd4c86]  metaspace::VirtualSpaceNode::retire(metaspace::ChunkManager*)+0xc0
V  [libjvm.dylib+0xe3e73]  VirtualSpaceNodeTest_half_vsn_is_committed_humongous_chunk_is_used_test_vm_Test::TestBody()+0x177
V  [libjvm.dylib+0x8944]  testing::Test::Run()+0x66
V  [libjvm.dylib+0x9417]  testing::TestInfo::Run()+0xbd
V  [libjvm.dylib+0x9964]  testing::TestCase::Run()+0xc4
V  [libjvm.dylib+0xe660]  testing::internal::UnitTestImpl::RunAllTests()+0x29a
V  [libjvm.dylib+0xe3a4]  testing::UnitTest::Run()+0x6c
V  [libjvm.dylib+0x1b45c]  runUnitTestsInner(int, char**)+0x315
C  [gtestLauncher+0xf82]  main+0x22
C  [libdyld.dylib+0x17085]  start+0x1

Comments
Fix Request Backporting this patch makes the test pass on x86_32 in 12u. Patch applies cleanly. jtreg:gtest/GTestWrapper.java fails before the patch, passes after the patch on x86_32. Passes before/after on x86_64. Testbug, risk is low.
09-04-2019

Fails the same way in 12u with x86_32 fastdebug: $ CONF=linux-x86-server-fastdebug make images run-test TEST=jtreg:gtest/GTestWrapper.java
09-04-2019

I don't understand how ChunkManagerRestorer could ever have worked properly. Maybe something changed, but it expects new chunks to be added to the end of chunklist, which is not the case (new items are prepended). The only case it works now is if there are no chunks in the chunk list when the test starts. I rewrote ChunkManagerRestorer to be more robust and not depended on the implementation details of chunklist. The new one doesn't care about which end new chunks are added to, and the failing test works. Need to cleanup the code...
17-01-2019

If I comment out the "four_pages_vsn_is_committed_some_is_used_by_chunks" test that comes right before the "VirtualSpaceNodeTest.half_vsn_is_committed_humongous_chunk_is_used_test_vm" it passes, so the test before affects the test after. I think there is a way to tell gtest to run a test case in a new VM instance? But the issue here, I think, is that the ChunkManagerRestorer is not doing its job.
11-01-2019

Also reproduced on Ubuntu 64bit 18.04 [ RUN ] VirtualSpaceNodeTest.sanity_test_vm [ OK ] VirtualSpaceNodeTest.sanity_test_vm (0 ms) [ RUN ] VirtualSpaceNodeTest.four_pages_vsn_is_committed_some_is_used_by_chunks_test_vm assert failed: list invariant [ OK ] VirtualSpaceNodeTest.four_pages_vsn_is_committed_some_is_used_by_chunks_test_vm (1 ms) [ RUN ] VirtualSpaceNodeTest.half_vsn_is_committed_humongous_chunk_is_used_test_vm # To suppress the following error report, specify this argument # after -XX: or in .hotspotrc: SuppressErrorAt=/freeList.inline.hpp:189 # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/home/gerard/Desktop/jdk13/open/src/hotspot/share/memory/freeList.inline.hpp:189), pid=6604, tid=6604 # assert(head() == __null || head()->prev() == __null) failed: list invariant # # JRE version: Java(TM) SE Runtime Environment (13.0) (fastdebug build 13-internal+0-adhoc.gerard.open) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 13-internal+0-adhoc.gerard.open, mixed mode, tiered, compressed oops, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0xab1a27] FreeList<metaspace::Metachunk>::return_chunk_at_head(metaspace::Metachunk*, bool)+0x57 # --------------- S U M M A R Y ------------ Command Line: -XX:+ExecutingUnitTests Host: gerard-VirtualBox, Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz, 2 cores, 1G, Ubuntu 18.04.1 LTS Time: Thu Jan 10 13:55:59 2019 CST elapsed time: 17 seconds (0d 0h 0m 17s) --------------- T H R E A D --------------- Current thread (0x000055ca66e8c000): JavaThread "main" [_thread_in_native, id=6604, stack(0x00007fffa8c29000,0x00007fffa8d29000)] Stack: [0x00007fffa8c29000,0x00007fffa8d29000], sp=0x00007fffa8d26fd0, free space=1015k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0xab1a27] FreeList<metaspace::Metachunk>::return_chunk_at_head(metaspace::Metachunk*, bool)+0x57 V [libjvm.so+0xaabb89] metaspace::ChunkManager::return_single_chunk(metaspace::Metachunk*)+0x219 V [libjvm.so+0x1c6ba6e] metaspace::VirtualSpaceNode::allocate_padding_chunks_until_top_is_at(MetaWord*)+0x2ce V [libjvm.so+0x1c6c438] metaspace::VirtualSpaceNode::take_from_committed(unsigned long)+0x348 V [libjvm.so+0x1c6cd96] metaspace::VirtualSpaceNode::retire(metaspace::ChunkManager*)+0xa6 V [libjvm.so+0x508ce2] VirtualSpaceNodeTest_half_vsn_is_committed_humongous_chunk_is_used_test_vm_Test::TestBody()+0x112 V [libjvm.so+0x3952f2] testing::Test::Run() [clone .part.400]+0x282 V [libjvm.so+0x39560d] testing::TestInfo::Run() [clone .part.405]+0x26d V [libjvm.so+0x3958a5] testing::TestCase::Run() [clone .part.406]+0x265 V [libjvm.so+0x39820a] testing::internal::UnitTestImpl::RunAllTests() [clone .part.410]+0xb0a V [libjvm.so+0x39842d] testing::UnitTest::Run()+0x6d V [libjvm.so+0x3a15d9] runUnitTestsInner(int, char**)+0x2b9 V [libjvm.so+0x3a185f] runUnitTests+0xdf C [gtestLauncher+0x6da] main+0x20
10-01-2019