With the introduction of flat arrays, it is strongly recommended to not use the method objArrayOop->obj_at(int) anymore. When this method is called with a flat array, the JVM has to buffer the element before returning it, which means performing an allocation in the Java heap, which can trigger an OOM. The method has no way to handle this OOM situation and would simply crash the whole JVM.
The recommended fixes are:
- use objArrayOop->obj_at(int, TRAPS) instead and add handling of a potential OOM error
- or ensure and enforce that the code is operating on non-flat arrays, by using refArrayKlass/refArrayOop types and calling refArrayOop->obj_at(int)
The stack walking code uses the problematic objArrayOop->obj_at(int) in the following methods:
bool BaseFrameStream::check_magic(objArrayHandle frames_array);
BaseFrameStream* BaseFrameStream::from_current(JavaThread* thread, jlong magic,
objArrayHandle frames_array);
void JavaFrameStream::fill_frame(int index, objArrayHandle frames_array,
const methodHandle& method, TRAPS);
void LiveFrameStream::fill_frame(int index, objArrayHandle frames_array,
const methodHandle& method, TRAPS);
The recommended fixes are:
- use objArrayOop->obj_at(int, TRAPS) instead and add handling of a potential OOM error
- or ensure and enforce that the code is operating on non-flat arrays, by using refArrayKlass/refArrayOop types and calling refArrayOop->obj_at(int)
The stack walking code uses the problematic objArrayOop->obj_at(int) in the following methods:
bool BaseFrameStream::check_magic(objArrayHandle frames_array);
BaseFrameStream* BaseFrameStream::from_current(JavaThread* thread, jlong magic,
objArrayHandle frames_array);
void JavaFrameStream::fill_frame(int index, objArrayHandle frames_array,
const methodHandle& method, TRAPS);
void LiveFrameStream::fill_frame(int index, objArrayHandle frames_array,
const methodHandle& method, TRAPS);
- duplicates
-
JDK-8378531 [lworld] Remove obj_at(int) from objArrayOopDesc and flatArrayOopDesc
-
- New
-