JDK-8250844 : Make sure {type,obj}ArrayOopDesc accessors check the bounds
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,15,16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-07-30
  • Updated: 2020-12-09
  • Resolved: 2020-08-02
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 11 JDK 13 JDK 15 JDK 16
11.0.9Fixed 13.0.6Fixed 15.0.1Fixed 16 b09Fixed
Related Reports
Relates :  
Relates :  
Description
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.
Comments
Fix request (13u) we need it in 13u, too. The patch doesn't require any adjustments, tier1 tests pass.
08-12-2020

So the assert coverage was effectively reduced with JDK-8189871 and JDK-8197999.
20-08-2020

This does not affect 8u, because there both objArrayOop and typeArrayOop are calling through their internal *_at_addr methods which already have similar asserts.
20-08-2020

Fix Request (11u) Same reason, applicability, testing as for 15u.
18-08-2020

Fix Request (15u) This improves Hotspot maintainability by providing more aggressive asserts. Patch applies cleanly to 15u, passes tier1 tests.
17-08-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/7fcf386cf62a User: shade Date: 2020-08-02 15:02:39 +0000
02-08-2020

mach5-one-shade-JDK-8250844-20200730-1912-13050825 passes.
31-07-2020

Candidate fix: https://cr.openjdk.java.net/~shade/8250844/webrev.01/ -- passes tier1.
30-07-2020