JDK-8310297 : assert(static_cast(result) == thing) with ctw
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 22
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-06-19
  • Updated: 2024-04-29
  • Resolved: 2023-06-21
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 22
22 b03Fixed
Related Reports
Relates :  
Relates :  
Description
Running ctw with https://repo1.maven.org/maven2/net/codebuilders/unoil/4.1.6/unoil-4.1.6.jar I get:

#  Internal Error (/home/roland/jdk-jdk/src/hotspot/share/utilities/globalDefinitions.hpp:522), pid=3554522, tid=3554523
#  assert(static_cast<T1>(result) == thing) failed: must be

  [libjvm.so+0xdb4569]  signed char checked_cast<signed char, int>(int)+0x40  (globalDefinitions.hpp:522)
V  [libjvm.so+0xd9ffe8]  initialize_static_primitive_field(fieldDescriptor*, Handle)+0xde  (javaClasses.cpp:820)
V  [libjvm.so+0xda02b2]  initialize_static_field(fieldDescriptor*, Handle, JavaThread*)+0xc9  (javaClasses.cpp:854)
V  [libjvm.so+0xd5d97d]  InstanceKlass::do_local_static_fields(void (*)(fieldDescriptor*, Handle, JavaThread*), Handle, JavaThread*)+0xa9  (instanceKlass.cpp:1717)
V  [libjvm.so+0xda0721]  java_lang_Class::initialize_mirror_fields(Klass*, Handle, Handle, Handle, JavaThread*)+0x6f  (javaClasses.cpp:918)
V  [libjvm.so+0xda0f41]  java_lang_Class::allocate_mirror(Klass*, bool, Handle, Handle, Handle&, Handle&, JavaThread*)+0x473  (javaClasses.cpp:1017)
V  [libjvm.so+0xda10da]  java_lang_Class::create_mirror(Klass*, Handle, Handle, Handle, Handle, JavaThread*)+0x168  (javaClasses.cpp:1047)
V  [libjvm.so+0x8c25c4]  ClassFileParser::fill_instance_klass(InstanceKlass*, bool, ClassInstanceInfo const&, JavaThread*)+0xf9c  (classFileParser.cpp:5344)
V  [libjvm.so+0x8c15a4]  ClassFileParser::create_instance_klass(bool, ClassInstanceInfo const&, JavaThread*)+0xac  (classFileParser.cpp:5168)
V  [libjvm.so+0x107da41]  KlassFactory::create_from_stream(ClassFileStream*, Symbol*, ClassLoaderData*, ClassLoadInfo const&, JavaThread*)+0x283  (klassFactory.cpp:204)
V  [libjvm.so+0x1580790]  SystemDictionary::resolve_class_from_stream(ClassFileStream*, Symbol*, Handle, ClassLoadInfo const&, JavaThread*)+0x144  (systemDictionary.cpp:888)
V  [libjvm.so+0x1580a4a]  SystemDictionary::resolve_from_stream(ClassFileStream*, Symbol*, Handle, ClassLoadInfo const&, JavaThread*)+0x6c  (systemDictionary.cpp:926)
V  [libjvm.so+0xec52b7]  jvm_define_class_common(char const*, _jobject*, signed char const*, int, _jobject*, char const*, JavaThread*)+0x241  (jvm.cpp:896)
V  [libjvm.so+0xec5f88]  JVM_DefineClassWithSource+0x9c  (jvm.cpp:1060)
C  [libjava.so+0xd885]  Java_java_lang_ClassLoader_defineClass1+0x205  (ClassLoader.c:139)

It happens following JDK-8309692.
Comments
Changeset: 70e1c92a Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2023-06-21 11:45:37 +0000 URL: https://git.openjdk.org/jdk/commit/70e1c92a7f1b5450058a2dd7dbdf9d88eb85e970
21-06-2023

[~roland] Thank you for reporting this and for the directions on how to run it.
21-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14571 Date: 2023-06-20 20:05:44 +0000
20-06-2023

ILW = HLM = P3
20-06-2023

Hi Coleen, $ cd test/hotspot/jtreg/testlibrary/ctw/ $ ALT_BOOTDIR=/home/roland/jdk-jdk/build/linux-x86_64-server-fastdebug/images/jdk/ make then: $ cd dist $ JAVA_HOME=/home/roland/jdk-jdk/build/linux-x86_64-server-fastdebug/images/jdk sh ./ctw.sh /home/roland/tmp/unoil-4.1.6.jar Let me know if that works for you.
20-06-2023

How do I run -XX:+CompileTheWorld now?
20-06-2023

[~coleenp] Since this starts to happen after JDK-8309692, can you also have a look at that?
20-06-2023