RFR (S) 8250844: Make sure {type, obj}ArrayOopDesc accessors check the bounds

Reingruber, Richard richard.reingruber at sap.com
Fri Jul 31 09:11:38 UTC 2020

Hi Aleksey,

it does make sense to add the range checks and your patch looks good to me.
// Not Reviewer though.

Maybe bounds should be checked even at a lower level, namely in HeapAccess?
At least when storing to the heap? Or would that be too pedantic, too expensive?
Just curious what you and others think.

Thanks, Richard. 

---------- Forwarded message ---------
From: Aleksey Shipilev <mailto:shade at redhat.com>
Date: Thu, Jul 30, 2020 at 9:04 PM
Subject: RFR (S) 8250844: Make sure {type, obj}ArrayOopDesc accessors check the bounds
To: mailto:hotspot-runtime-dev at openjdk.java.net <mailto:hotspot-runtime-dev at openjdk.java.net>


I was debugging some new VM patch, and figured it was a memory stomp due to wrong index passed to
objArrayOopDesc::obj_at_put. That method does not assert the index at all, which hides the errors
and silently corrupts the heap, until something else discovers it. Some objArrayOopDesc accessors do
verify the index against the bounds. Same thing goes for typeArrayOopDesc.


Testing: tier{1,2} locally; jdk-submit (running)


More information about the hotspot-runtime-dev mailing list