RFR (S) 8228485: JVM crashes when bootstrap method for condy triggers loading of class whose static initializer throws exception

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Wed Jul 24 12:48:31 UTC 2019



On 7/24/19 1:49 AM, David Holmes wrote:
> On 24/07/2019 1:14 am, coleen.phillimore at oracle.com wrote:
>> On 7/23/19 9:15 AM, David Holmes wrote:
>>> Hi Coleen,
>>>
>>> On 23/07/2019 9:59 pm, coleen.phillimore at oracle.com wrote:
>>>> Summary: Add case for JVM_CONSTANT_Dynamic in error_message function.
>>>
>>> Fix seems reasonable. Begs the question as to whether there are 
>>> other missing cases for this code?
>>
>> No, there are not currently.  Only these constant pool tags use 
>> save_and_throw_exception, in order to throw the same exception for 
>> each time the cp entry is resolved with an error:
>>
>> jbyte constantTag::error_value() const {
>>    switch (_tag) {
>>    case JVM_CONSTANT_UnresolvedClass:
>>      return JVM_CONSTANT_UnresolvedClassInError;
>>    case JVM_CONSTANT_MethodHandle:
>>      return JVM_CONSTANT_MethodHandleInError;
>>    case JVM_CONSTANT_MethodType:
>>      return JVM_CONSTANT_MethodTypeInError;
>>    case JVM_CONSTANT_Dynamic:
>>      return JVM_CONSTANT_DynamicInError;
>>    default:
>>      ShouldNotReachHere();
>>      return JVM_CONSTANT_Invalid;
>>    }
>> }
>
> Ok.
>
>>>
>>> Can this manifest with regular Java sources? I'm unclear exactly how 
>>> this is being manifested in the jasm file.
>>
>> The jasm file is to force initialization of the static class inside 
>> the Condy expression.  Otherwise it may be initialized outside and 
>> not hit the error.
>
> Okay. I don't know what source code would lead to use of a condy such 
> that I could suggest how to avoid using jasm. So jasm is fine.
>
> IIUC this is not a regression but a day one problem with condy?

It's a day one omission, not a regression.

Thanks,
Coleen
>
> Thanks,
> David
> -----
>
>> thanks,
>> Coleen
>>>
>>> Thanks,
>>> David
>>>
>>>> Tested locally with hotspot and java/lang/invoke condy tests and 
>>>> new test which exercises the code.  This might be needed for jdk 13.
>>>>
>>>> open webrev at 
>>>> http://cr.openjdk.java.net/~coleenp/2019/8228485.01/webrev
>>>> bug link https://bugs.openjdk.java.net/browse/JDK-8228485
>>>>
>>>> Thanks,
>>>> Coleen
>>



More information about the hotspot-runtime-dev mailing list