JDK-8288592 : JVMTI GetClassSignature/getclsig005 failed "assert(_adapter.pos() == this->start_pos()) failed: invariant"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 19
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: windows
  • CPU: x86_64
  • Submitted: 2022-06-16
  • Updated: 2022-07-05
  • Resolved: 2022-07-04
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 19
19Resolved
Related Reports
Duplicate :  
Description
The following test failed in the JDK19 CI:

vmTestbase/nsk/jvmti/GetClassSignature/getclsig005/TestDescription.java

Here's a snippet from the log file:

#section:main
----------messages:(4/263)----------
command: main -agentlib:getclsig005 nsk.jvmti.GetClassSignature.getclsig005
reason: User specified action: run main/othervm/native -agentlib:getclsig005 nsk.jvmti.GetClassSignature.getclsig005 
Mode: othervm [/othervm specified]
elapsed time (seconds): 5.847
----------configuration:(0/0)----------
----------System.out:(21/1441)*----------
[2.135s][info][jfr,startup] Started recording 1. No limit specified, using maxsize=250MB as default.
[2.135s][info][jfr,startup] 
[2.135s][info][jfr,startup] Use jcmd 20416 JFR.dump name=1 filename=FILEPATH to copy recording data to file.
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=\\jfr/writers/jfrStorageHost.inline.hpp:79
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (c:\\sb\\prod\\1655229940\\workspace\\open\\src\\hotspot\\share\\jfr/writers/jfrStorageHost.inline.hpp:79), pid=20416, tid=62384
#  assert(_adapter.pos() == this->start_pos()) failed: invariant
#
# JRE version: Java(TM) SE Runtime Environment (19.0+27) (fastdebug build 19-ea+27-2073)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 19-ea+27-2073, mixed mode, sharing, tiered, compressed class ptrs, g1 gc, windows-amd64)
# Core dump will be written. Default location: C:\\sb\\prod\\1655344039\\testoutput\\test-support\\jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jvmti_quick\\scratch\\0\\hs_err_pid20416.mdmp
#
# An error report file with more information is saved as:
# C:\\sb\\prod\\1655344039\\testoutput\\test-support\\jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jvmti_quick\\scratch\\0\\hs_err_pid20416.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
----------System.err:(0/0)----------
----------rerun:(40/6550)*----------


Here's the crashing thread's stack:

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

Current thread (0x000001a1f477bc70):  JfrThreadSampler "JFR Thread Sampler" [stack: 0x0000001e41a00000,0x0000001e41b00000] [id=62384]

Stack: [0x0000001e41a00000,0x0000001e41b00000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xc84b61]  os::platform_print_native_stack+0xf1  (os_windows_x86.cpp:235)
V  [jvm.dll+0xee62db]  VMError::report+0x10eb  (vmError.cpp:835)
V  [jvm.dll+0xee7e1e]  VMError::report_and_die+0x7fe  (vmError.cpp:1687)
V  [jvm.dll+0xee85a4]  VMError::report_and_die+0x64  (vmError.cpp:1468)
V  [jvm.dll+0x5a7167]  report_vm_error+0xb7  (debug.cpp:283)
V  [jvm.dll+0x821794]  JfrCheckpointWriter::release+0xb4  (jfrCheckpointWriter.cpp:124)
V  [jvm.dll+0x8213bd]  JfrCheckpointWriter::~JfrCheckpointWriter+0x11d  (jfrCheckpointWriter.cpp:107)
V  [jvm.dll+0x8727bb]  JfrTypeManager::write_checkpoint+0x17b  (jfrTypeManager.cpp:132)
V  [jvm.dll+0x81fe98]  JfrCheckpointManager::write_checkpoint+0x48  (jfrCheckpointManager.cpp:584)
V  [jvm.dll+0x868d62]  JfrThreadLocal::on_start+0x52  (jfrThreadLocal.cpp:120)
V  [jvm.dll+0xe58948]  Thread::call_run+0xc8  (thread.cpp:349)
V  [jvm.dll+0xc83409]  thread_native_entry+0xb9  (os_windows.cpp:545)
C  [ucrtbase.dll+0x26b4c]
C  [KERNEL32.DLL+0x14ed0]
C  [ntdll.dll+0x7e39b]
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk19/pull/108 Date: 2022-07-05 10:14:02 +0000
05-07-2022

jvm!JfrCheckpointWriter +0x000 __VFN_table : 0x00007ffd`2b478fa8 +0x008 _start_pos : 0x000001a1`f399cb9d "" <--- +0x010 _current_pos : 0x000001a1`f399cbdc "???" +0x018 _end_pos : 0x000001a1`f3a1c748 "???" +0x020 _adapter : Adapter<JfrCheckpointFlush> +0x030 _access : ExclusiveAccessAssert +0x038 _compressed_integers : 1 +0x040 _time : TimeInstant<CounterRepresentation,FastUnorderedElapsedCounterSource> +0x048 _offset : 0n0 +0x050 _count : 1 +0x054 _type : 8 ( THREADS ) +0x058 _header : 1 _adapter dx -r1 ((jvm!JfrBuffer *)0x1a1f399c720) ((jvm!JfrBuffer *)0x1a1f399c720) : 0x1a1f399c720 [Type: JfrBuffer *] [+0x000] _next : 0x1a1f389c680 [Type: JfrBuffer *] [+0x008] _identity : 0x0 [Type: void *] [+0x010] _pos : 0x1a1f399c748 : 0x0 [Type: unsigned char *] <-- [+0x018] _top : 0x1a1f399c748 : 0x0 [Type: unsigned char *] [+0x020] _size : 0x10000 [Type: unsigned int] [+0x024] _header_size : 0x28 [Type: unsigned short] [+0x026] _flags : 0x4 [Type: unsigned char] [+0x027] _context : 0x0 [Type: unsigned char] The start position of the checkpointwriter instance do not correspond with the lower level adapter API _pos. This is indicative of a race. Because the _identity is 0x0 and _pos == _top, it implies the buffer was reset from underneath the writer.
04-07-2022