-
Bug
-
Resolution: Fixed
-
P2
-
22
-
b08
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8325411 | 22.0.1 | Calvin Cheung | P2 | Resolved | Fixed | b04 |
JDK-8324737 | 22 | Calvin Cheung | P2 | Resolved | Fixed | b35 |
When running the following Java program:
public class Test {
public static void main(String[] args) throws Exception {
new java.text.SimpleDateFormat();
}
}
with the JMC agent (https://github.com/openjdk/jmc/tree/master/agent) on a debug VM, the VM runs into an assertion:
# Internal Error (/usr/work/d039344/git/github.com/openjdk/jdk/src/hotspot/share/oops/instanceKlass.cpp:394), pid=94447, tid=94448
# assert(this_key != nullptr) failed: sanity
The problem seems tp be that the check_shared_class_super_types() in systemDictonary.cpp:1140 returns false, since the
IntFunction interface of the proxy class resolves to:
java.util.function.IntFunction {0x00007f29a30bcba8}
- instance size: 2
- klass size: 65
- access: public interface abstract
- flags: rewritten
- state: linked
- name: 'java/util/function/IntFunction'
- super: 'java/lang/Object'
- sub:
- nof implementors: 2
- arrays: null
- methods: Array<T>(0x00007f299e64ccc8)
- method ordering: Array<T>(0x00007f29a2bdbd08)
- default_methods: Array<T>(0x0000000000000000)
- local interfaces: Array<T>(0x00007f29a26aae30)
- trans. interfaces: Array<T>(0x00007f29a26aae30)
- constants: constant pool [14] {0x00007f299e64cbf0} for 'java/util/function/IntFunction' cache=0x00007f299e64d0b0
- class loader data: loader data: 0x00007f2a4421b0a0 of 'bootstrap'
- source file: 'IntFunction.java'
- class annotations: Array<T>(0x00007f299e64cd88)
- class type annotations: Array<T>(0x0000000000000000)
- field annotations: Array<T>(0x0000000000000000)
- field type annotations: Array<T>(0x0000000000000000)
- generic signature: '<R:Ljava/lang/Object;>Ljava/lang/Object;'
- inner classes: Array<T>(0x00007f29a26aadb8)
- nest members: Array<T>(0x00007f29a26aadb8)
- permitted subclasses: Array<T>(0x00007f29a26aadb8)
- java mirror: a 'java/lang/Class'{0x000000011e2537c0} = 'java/util/function/IntFunction'
- vtable length 5 (start addr: 0x00007f29a30bcd80)
- itable length 0 (start addr: 0x00007f29a30bcda8)
- ---- static fields (0 words):
- ---- non-static fields (0 words):
- non-static oop maps:
instead of
java.util.function.IntFunction {0x00007f29a217e760}
- instance size: 2
- klass size: 65
- access: public interface abstract
- flags: rewritten is_shared_boot_class
- state: allocated
- name: 'java/util/function/IntFunction'
- super: 'java/lang/Object'
- sub:
- nof implementors: 0
- arrays: null
- methods: Array<T>(0x00007f29a28de5b8)
- method ordering: Array<T>(0x00007f29a28de608)
- default_methods: Array<T>(0x0000000000000000)
- local interfaces: Array<T>(0x00007f29a26aae30)
- trans. interfaces: Array<T>(0x00007f29a26aae30)
- constants: constant pool [14] {0x00007f29a28de4f8} for 'java/util/function/IntFunction' cache=0x00007f29a217e980
- source file: 'IntFunction.java'
- class annotations: Array<T>(0x00007f29a28de4e8)
- class type annotations: Array<T>(0x0000000000000000)
- field annotations: Array<T>(0x0000000000000000)
- field type annotations: Array<T>(0x0000000000000000)
- generic signature: '<R:Ljava/lang/Object;>Ljava/lang/Object;'
- inner classes: Array<T>(0x00007f29a26aadb8)
- nest members: Array<T>(0x00007f29a26aadb8)
- permitted subclasses: Array<T>(0x00007f29a26aadb8)
- java mirror: null
- vtable length 5 (start addr: 0x00007f29a217e938)
- itable length 0 (start addr: 0x00007f29a217e960)
- ---- static fields (0 words):
- ---- non-static fields (0 words):
- non-static oop maps:
Here is the lambda class:
sun.util.locale.provider.LocaleProviderAdapter$$Lambda/0x80000006e {0x00007f29a2387858}
- instance size: 2
- klass size: 69
- access: final synchronized synthetic
- flags: rewritten should_verify_class is_shared_boot_class has_vanilla_constructor
- state: allocated
- name: 'sun/util/locale/provider/LocaleProviderAdapter$$Lambda+0x80000006e'
- super: 'java/lang/Object'
- sub:
- arrays: null
- methods: Array<T>(0x00007f29a2bdb300)
- method ordering: Array<T>(0x00007f29a2bdb398)
- default_methods: Array<T>(0x0000000000000000)
- local interfaces: Array<T>(0x00007f29a2bdb1f8)
- trans. interfaces: Array<T>(0x00007f29a2bdb1f8)
- constants: constant pool [21] {0x00007f29a2bdb208} for 'sun/util/locale/provider/LocaleProviderAdapter$$Lambda+0x80000006e' cache=0x00007f29a2387aa0
- class annotations: Array<T>(0x0000000000000000)
- class type annotations: Array<T>(0x0000000000000000)
- field annotations: Array<T>(0x0000000000000000)
- field type annotations: Array<T>(0x0000000000000000)
- inner classes: Array<T>(0x00007f29a26aadb8)
- nest members: Array<T>(0x00007f29a26aadb8)
- permitted subclasses: Array<T>(0x00007f29a26aadb8)
- java mirror: null
- vtable length 5 (start addr: 0x00007f29a2387a30)
- itable length 5 (start addr: 0x00007f29a2387a58)
- ---- static fields (0 words):
- ---- non-static fields (0 words):
- non-static oop maps:
Because of this the class loader data is never set for the proxy in SystemDictionary::load_shared_lambda_proxy_class() and the assertion triggers.
Best regards,
Ralf
public class Test {
public static void main(String[] args) throws Exception {
new java.text.SimpleDateFormat();
}
}
with the JMC agent (https://github.com/openjdk/jmc/tree/master/agent) on a debug VM, the VM runs into an assertion:
# Internal Error (/usr/work/d039344/git/github.com/openjdk/jdk/src/hotspot/share/oops/instanceKlass.cpp:394), pid=94447, tid=94448
# assert(this_key != nullptr) failed: sanity
The problem seems tp be that the check_shared_class_super_types() in systemDictonary.cpp:1140 returns false, since the
IntFunction interface of the proxy class resolves to:
java.util.function.IntFunction {0x00007f29a30bcba8}
- instance size: 2
- klass size: 65
- access: public interface abstract
- flags: rewritten
- state: linked
- name: 'java/util/function/IntFunction'
- super: 'java/lang/Object'
- sub:
- nof implementors: 2
- arrays: null
- methods: Array<T>(0x00007f299e64ccc8)
- method ordering: Array<T>(0x00007f29a2bdbd08)
- default_methods: Array<T>(0x0000000000000000)
- local interfaces: Array<T>(0x00007f29a26aae30)
- trans. interfaces: Array<T>(0x00007f29a26aae30)
- constants: constant pool [14] {0x00007f299e64cbf0} for 'java/util/function/IntFunction' cache=0x00007f299e64d0b0
- class loader data: loader data: 0x00007f2a4421b0a0 of 'bootstrap'
- source file: 'IntFunction.java'
- class annotations: Array<T>(0x00007f299e64cd88)
- class type annotations: Array<T>(0x0000000000000000)
- field annotations: Array<T>(0x0000000000000000)
- field type annotations: Array<T>(0x0000000000000000)
- generic signature: '<R:Ljava/lang/Object;>Ljava/lang/Object;'
- inner classes: Array<T>(0x00007f29a26aadb8)
- nest members: Array<T>(0x00007f29a26aadb8)
- permitted subclasses: Array<T>(0x00007f29a26aadb8)
- java mirror: a 'java/lang/Class'{0x000000011e2537c0} = 'java/util/function/IntFunction'
- vtable length 5 (start addr: 0x00007f29a30bcd80)
- itable length 0 (start addr: 0x00007f29a30bcda8)
- ---- static fields (0 words):
- ---- non-static fields (0 words):
- non-static oop maps:
instead of
java.util.function.IntFunction {0x00007f29a217e760}
- instance size: 2
- klass size: 65
- access: public interface abstract
- flags: rewritten is_shared_boot_class
- state: allocated
- name: 'java/util/function/IntFunction'
- super: 'java/lang/Object'
- sub:
- nof implementors: 0
- arrays: null
- methods: Array<T>(0x00007f29a28de5b8)
- method ordering: Array<T>(0x00007f29a28de608)
- default_methods: Array<T>(0x0000000000000000)
- local interfaces: Array<T>(0x00007f29a26aae30)
- trans. interfaces: Array<T>(0x00007f29a26aae30)
- constants: constant pool [14] {0x00007f29a28de4f8} for 'java/util/function/IntFunction' cache=0x00007f29a217e980
- source file: 'IntFunction.java'
- class annotations: Array<T>(0x00007f29a28de4e8)
- class type annotations: Array<T>(0x0000000000000000)
- field annotations: Array<T>(0x0000000000000000)
- field type annotations: Array<T>(0x0000000000000000)
- generic signature: '<R:Ljava/lang/Object;>Ljava/lang/Object;'
- inner classes: Array<T>(0x00007f29a26aadb8)
- nest members: Array<T>(0x00007f29a26aadb8)
- permitted subclasses: Array<T>(0x00007f29a26aadb8)
- java mirror: null
- vtable length 5 (start addr: 0x00007f29a217e938)
- itable length 0 (start addr: 0x00007f29a217e960)
- ---- static fields (0 words):
- ---- non-static fields (0 words):
- non-static oop maps:
Here is the lambda class:
sun.util.locale.provider.LocaleProviderAdapter$$Lambda/0x80000006e {0x00007f29a2387858}
- instance size: 2
- klass size: 69
- access: final synchronized synthetic
- flags: rewritten should_verify_class is_shared_boot_class has_vanilla_constructor
- state: allocated
- name: 'sun/util/locale/provider/LocaleProviderAdapter$$Lambda+0x80000006e'
- super: 'java/lang/Object'
- sub:
- arrays: null
- methods: Array<T>(0x00007f29a2bdb300)
- method ordering: Array<T>(0x00007f29a2bdb398)
- default_methods: Array<T>(0x0000000000000000)
- local interfaces: Array<T>(0x00007f29a2bdb1f8)
- trans. interfaces: Array<T>(0x00007f29a2bdb1f8)
- constants: constant pool [21] {0x00007f29a2bdb208} for 'sun/util/locale/provider/LocaleProviderAdapter$$Lambda+0x80000006e' cache=0x00007f29a2387aa0
- class annotations: Array<T>(0x0000000000000000)
- class type annotations: Array<T>(0x0000000000000000)
- field annotations: Array<T>(0x0000000000000000)
- field type annotations: Array<T>(0x0000000000000000)
- inner classes: Array<T>(0x00007f29a26aadb8)
- nest members: Array<T>(0x00007f29a26aadb8)
- permitted subclasses: Array<T>(0x00007f29a26aadb8)
- java mirror: null
- vtable length 5 (start addr: 0x00007f29a2387a30)
- itable length 5 (start addr: 0x00007f29a2387a58)
- ---- static fields (0 words):
- ---- non-static fields (0 words):
- non-static oop maps:
Because of this the class loader data is never set for the proxy in SystemDictionary::load_shared_lambda_proxy_class() and the assertion triggers.
Best regards,
Ralf
- backported by
-
JDK-8324737 Null CLD while loading shared lambda proxy class with javaagent active
-
- Resolved
-
-
JDK-8325411 Null CLD while loading shared lambda proxy class with javaagent active
-
- Resolved
-
- relates to
-
JDK-8296433 Encountered null CLD while loading shared lambda proxy class
-
- Resolved
-
- links to
-
Commit openjdk/jdk22/ee4d54c5
-
Commit openjdk/jdk/d51aaf63
-
Review openjdk/jdk22/102
-
Review openjdk/jdk/17602
(2 links to)