[foreign-memaccess] RFR: 8227424: C2 assertion failures with debug build

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Jul 10 08:32:30 UTC 2019


On 10/07/2019 08:42, Nick Gasson wrote:
> Hi Maurizio,
>
>>
>> In the case of the ASM generated code, I believe we have it the wrong 
>> way
>> around, as the expected type is VarHandleMemoryAddressAsInts1, but 
>> the found
>> type is just VarHandleMemoryAddressBase - which I don't think is 
>> enough to
>> satisfy the verifier rules. I think it's more likely that this rule 
>> has never
>> been enforced too strictly - but it's nevertheless there.
>>
>> I agree that it would be nice to know some background here - if the 
>> code indeed
>> violates the verifier spec, why is this just a debug-only assertion?
>>
>
> Is it just that the verifier isn't running when we define the class 
> through Unsafe.defineAnonymousClass? I tried something similar in a 
> regular .class file and it threw "java.lang.VerifyError: Bad type on 
> operand stack" when loading.

Excellent point - yes, I've seen in the past defineAnonymousClass 
triggering small differences in verifier behavior.

I think you can go ahead with the fix, as it makes the world generally 
better.

Thanks!
Maurizio

>
> Thanks,
> Nick
>


More information about the panama-dev mailing list