RFR: 8337217: Port VirtualMemoryTracker to use VMATree

Afshin Zafari azafari at openjdk.org
Fri Nov 8 10:52:04 UTC 2024


On Sat, 12 Oct 2024 14:24:15 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> No, returned back.
>> This assert is triggered:
>> 
>> #  Internal Error (/home/afshin/scratch/833XX_nmt_VMT_with_tree/src/hotspot/share/utilities/growableArray.hpp:142), pid=1972883, tid=1972931
>> #  assert(0 <= i && i < _len) failed: illegal index 0 for length 0
>
> Why is this assert triggered? That sounds like a bug.

The assertion that happens during building jdk-image:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/afshin/scratch/833XX_nmt_VMT_with_tree/src/hotspot/share/utilities/growableArray.hpp:142), pid=1234272, tid=1234278
#  assert(0 <= i && i < _len) failed: illegal index 0 for length 0
#
# JRE version:  (24.0) (fastdebug build )
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 24-internal-2024-09-30-0937351.afshin..., mixed mode, emulated-client, tiered, compressed oops, compressed class ptrs, serial gc, linux-amd64)
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/afshin/scratch/833XX_nmt_VMT_with_tree/make/core.1234272)
#
#

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

Command Line: -Denv.class.path= -Dapplication.home=/home/afshin/scratch/833XX_nmt_VMT_with_tree/build/linux-x64/jdk -Xms8m -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1 -Djdk.module.main=jdk.jlink jdk.jlink/jdk.tools.jmod.Main create --module-version 24-internal --target-platform linux-amd64 --module-path /home/afshin/scratch/833XX_nmt_VMT_with_tree/build/linux-x64/images/jmods --libs /home/afshin/scratch/833XX_nmt_VMT_with_tree/build/linux-x64/support/modules_libs/jdk.sctp --class-path /home/afshin/scratch/833XX_nmt_VMT_with_tree/build/linux-x64/jdk/modules/jdk.sctp --legal-notices /home/afshin/scratch/833XX_nmt_VMT_with_tree/build/linux-x64/support/modules_legal/common --exclude **{_the.*,_*.marker*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM} --compress zip-1 --date 2024-09-30T09:37:57Z /home/afshin/scratch/833XX_nmt_VMT_with_tree/build/linux-x64/support/images/jmods/jdk.sctp.jmod

Host: afshin-Precision-7920-Tower, Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz, 40 cores, 62G, Ubuntu 20.04.6 LTS
Time: Mon Oct 14 10:52:34 2024 CEST elapsed time: 0.002402 seconds (0d 0h 0m 0s)

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

Current thread is native thread

Stack: [0x00007ffa5243a000,0x00007ffa5253b000],  sp=0x00007ffa52539390,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x18df026]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x486  (growableArray.hpp:142)
V  [libjvm.so+0x18df870]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, ...)+0x0  (vmError.cpp:1611)
V  [libjvm.so+0xac3a81]  report_vm_error(char const*, int, char const*, char const*, ...)+0xf1  (debug.cpp:193)
V  [libjvm.so+0x15f7851]  void Treap<unsigned long, VMATree::IntervalChange, VMATree::PositionComparator, TreapCHeapAllocator>::visit_in_order<RegionsTree::visit_reserved_regions<RegionsTree::find_reserved_region(unsigned char*)::{lambda(ReservedMemoryRegion&)#1}>(RegionsTree::find_reserved_region(unsigned char*)::{lambda(ReservedMemoryRegion&)#1})::{lambda(Treap<unsigned long, VMATree::IntervalChange, VMATree::PositionComparator, TreapCHeapAllocator>::TreapNode*)#1}>(RegionsTree::visit_reserved_regions<RegionsTree::find_reserved_region(unsigned char*)::{lambda(ReservedMemoryRegion&)#1}>(RegionsTree::find_reserved_region(unsigned char*)::{lambda(ReservedMemoryRegion&)#1})::{lambda(Treap<unsigned long, VMATree::IntervalChange, VMATree::PositionComparator, TreapCHeapAllocator>::TreapNode*)#1}) const+0x4c1  (growableArray.hpp:142)
V  [libjvm.so+0x15f7b59]  RegionsTree::commit_region(unsigned char*, unsigned long, NativeCallStack const&)+0x149  (vmatree.hpp:227)
V  [libjvm.so+0x18cc8cc]  VirtualMemoryTracker::add_committed_region(unsigned char*, unsigned long, NativeCallStack const&)+0x2c  (virtualMemoryTracker.cpp:150)
V  [libjvm.so+0x14dc5b7]  os::commit_memory(char*, unsigned long, bool)+0x97  (memTracker.hpp:175)
V  [libjvm.so+0xac611f]  initialize_assert_poison()+0x7f  (debug.cpp:715)
V  [libjvm.so+0x181aecd]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x53d  (threads.cpp:490)
V  [libjvm.so+0xfb4494]  JNI_CreateJavaVM+0x54  (jni.cpp:3596)
C  [libjli.so+0x432f]  JavaMain+0x8f  (java.c:1490)
C  [libjli.so+0x79b9]  ThreadJavaMain+0x9  (java_md.c:633)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20425#discussion_r1799014090


More information about the core-libs-dev mailing list