RFR: 8261395: C1 crash "cannot make java calls from the native compiler" [v2]

David Holmes david.holmes at oracle.com
Wed May 12 05:17:25 UTC 2021


Hi Coleen,

On 12/05/2021 9:34 am, Coleen Phillimore wrote:
> On Sun, 9 May 2021 22:10:24 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> David Holmes has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains ten additional commits since the last revision:
>>
>>   - Update test per Coleen's comments:
>>     - need to add java.security.manager=allow just to be safe
>>     - simplify logic to read classfile from disk (ref ClassUnloadCommon.getClassData())
>>   - Merge branch 'master' into 8261395-nestmember
>>   - Per Coleen: Reverse arguments order for has_nest_member so we can revert the introduction of "current".
>>   - Fix typo
>>   - Completely simpified the has_nest_member check to only use names.
>>     This avoids any possibility of class loading or executing any Java
>>     code and removes all possibility of exceptions in this part of the
>>     nestmate verification process.
>>   - Add test
>>   - Tweak logging message
>>   - 8261395: C1 crash "cannot make java calls from the native compiler"
>>   - First cleanup: when we have a resolved klass we don't need to use klass_at but can use resolved_klass_at. Now exceptions are truly impossible.
> 
> Looks good to me!
> 
> test/hotspot/jtreg/runtime/Nestmates/protectionDomain/TestDifferentProtectionDomains.java line 80:
> 
>> 78:                     try {
>> 79:                         String clzFile = name.replaceAll("\\.", "/") + ".class";
>> 80:                         byte[] buff = getResourceAsStream(clzFile).readAllBytes();
> 
> There's a ClassUnloadCommon.getBytesForClass(name) that you could have called that does essentially what these two lines do.  Maybe it's different enough to have this, so it's up to you to change it.

It would be "wrong" to actually call that as it calls 
getResourceAsStream on a different ClassLoader. So I used the same logic 
but applied to the custom classloader instance.

Thanks for the review.

David
-----

> -------------
> 
> Marked as reviewed by coleenp (Reviewer).
> 
> PR: https://git.openjdk.java.net/jdk/pull/3913
> 


More information about the hotspot-runtime-dev mailing list