Skip to content

Commit be7343d

Browse files
committedJan 5, 2022
8277342: vmTestbase/nsk/stress/strace/strace004.java fails with SIGSEGV in InstanceKlass::jni_id_for
Backport-of: 09e8c8c64abf4178a042c79b92d7e08e54467331
1 parent de11e6b commit be7343d

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed
 

‎src/hotspot/share/oops/instanceKlass.cpp

+3-14
Original file line numberDiff line numberDiff line change
@@ -1839,29 +1839,18 @@ Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name,
18391839
return NULL;
18401840
}
18411841

1842-
/* jni_id_for_impl for jfieldIds only */
1843-
JNIid* InstanceKlass::jni_id_for_impl(int offset) {
1842+
/* jni_id_for for jfieldIds only */
1843+
JNIid* InstanceKlass::jni_id_for(int offset) {
18441844
MutexLocker ml(JfieldIdCreation_lock);
1845-
// Retry lookup after we got the lock
18461845
JNIid* probe = jni_ids() == NULL ? NULL : jni_ids()->find(offset);
18471846
if (probe == NULL) {
1848-
// Slow case, allocate new static field identifier
1847+
// Allocate new static field identifier
18491848
probe = new JNIid(this, offset, jni_ids());
18501849
set_jni_ids(probe);
18511850
}
18521851
return probe;
18531852
}
18541853

1855-
1856-
/* jni_id_for for jfieldIds only */
1857-
JNIid* InstanceKlass::jni_id_for(int offset) {
1858-
JNIid* probe = jni_ids() == NULL ? NULL : jni_ids()->find(offset);
1859-
if (probe == NULL) {
1860-
probe = jni_id_for_impl(offset);
1861-
}
1862-
return probe;
1863-
}
1864-
18651854
u2 InstanceKlass::enclosing_method_data(int offset) const {
18661855
const Array<jushort>* const inner_class_list = inner_classes();
18671856
if (inner_class_list == NULL) {

‎src/hotspot/share/oops/instanceKlass.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -1300,8 +1300,6 @@ class InstanceKlass: public Klass {
13001300
void initialize_impl (TRAPS);
13011301
void initialize_super_interfaces (TRAPS);
13021302
void eager_initialize_impl ();
1303-
/* jni_id_for_impl for jfieldID only */
1304-
JNIid* jni_id_for_impl (int offset);
13051303

13061304
// Returns the array class for the n'th dimension
13071305
Klass* array_klass_impl(bool or_null, int n, TRAPS);

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jan 5, 2022

@openjdk-notifier[bot]
Please sign in to comment.