RFR: 8323243: JNI invocation of an abstract instance method corrupts the stack

Aleksey Shipilev shade at openjdk.org
Wed Jan 10 15:28:21 UTC 2024


On Wed, 10 Jan 2024 12:50:43 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> See JBS for details.
>> 
>> TL;DR - if an instance method is abstract then JNI front-end should throw AbstractMethodError.
>> 
>> Testing:
>>   - new regression test
>>   -  tiers 1-3 (sanity)
>> 
>> Thanks.
>
> test/hotspot/jtreg/runtime/jni/abstractMethod/TestJNIAbstractMethod.java line 51:
> 
>> 49: 
>> 50:     public static void main(String[] args) {
>> 51:         AbstractMethod obj = new AbstractMethod();
> 
> So this doesn't result in an exception when you new this class?  Can you call this AbstractMethodClass or something like that?

It would also be good to have a positive test here: calling the method from plain Java should throw AME as well.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17337#discussion_r1447539996


More information about the hotspot-runtime-dev mailing list