RFR: 8177673: [JVMCI] missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RFR: 8177673: [JVMCI] missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail

Doug Simon @ Oracle
Please review this patch to fix a VM-level assertion failure due to missing sanity checks in HotSpotMemoryAccessProviderImpl. The sanity checking has been enhanced to map an object+displacement back to a field before performing a read. If the mapping fails, an IllegalArgumentException is thrown.

Tested on Graal.

-Doug

http://cr.openjdk.java.net/~dnsimon/8177673/webrev/
https://bugs.openjdk.java.net/browse/JDK-8177673
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR: 8177673: [JVMCI] missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail

Igor Veresov
Looks good.

igor

> On Mar 30, 2017, at 3:30 PM, Doug Simon <[hidden email]> wrote:
>
> Please review this patch to fix a VM-level assertion failure due to missing sanity checks in HotSpotMemoryAccessProviderImpl. The sanity checking has been enhanced to map an object+displacement back to a field before performing a read. If the mapping fails, an IllegalArgumentException is thrown.
>
> Tested on Graal.
>
> -Doug
>
> http://cr.openjdk.java.net/~dnsimon/8177673/webrev/
> https://bugs.openjdk.java.net/browse/JDK-8177673

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR: 8177673: [JVMCI] missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail

Tom Rodriguez-2
In reply to this post by Doug Simon @ Oracle
Looks good.

tom

Doug Simon wrote:
> Please review this patch to fix a VM-level assertion failure due to missing sanity checks in HotSpotMemoryAccessProviderImpl. The sanity checking has been enhanced to map an object+displacement back to a field before performing a read. If the mapping fails, an IllegalArgumentException is thrown.
>
> Tested on Graal.
>
> -Doug
>
> http://cr.openjdk.java.net/~dnsimon/8177673/webrev/
> https://bugs.openjdk.java.net/browse/JDK-8177673
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR: 8177673: [JVMCI] missing checks in HotSpotMemoryAccessProviderImpl can cause VM assertions to fail

Doug Simon @ Oracle
In reply to this post by Doug Simon @ Oracle
I've had to rework this patch after talking to the Truffle team. Truffle doesn't always read in compliance with field layout. For example, Truffle can perform a short read from an int field or a long read from an int array or pair of adjacent int fields. Since we only care about not making the VM crash or halt due to a VM assertion, the checks performed by JVMCI should allow the above kinds of access. As such, I've relaxed the checking to only ensure that a read is within the bounds of an object or array. Only in the case of an object read do we now check that the displacement of the read corresponds to a field (which must be of kind JavaKind.Object).

Please re-review this patch in light of the above.

-Doug

> On 31 Mar 2017, at 00:30, Doug Simon <[hidden email]> wrote:
>
> Please review this patch to fix a VM-level assertion failure due to missing sanity checks in HotSpotMemoryAccessProviderImpl. The sanity checking has been enhanced to map an object+displacement back to a field before performing a read. If the mapping fails, an IllegalArgumentException is thrown.
>
> Tested on Graal.
>
> -Doug
>
> http://cr.openjdk.java.net/~dnsimon/8177673/webrev/
> https://bugs.openjdk.java.net/browse/JDK-8177673

Loading...