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

Coleen Phillimore coleenp at openjdk.org
Wed Jan 10 12:55:25 UTC 2024


On Wed, 10 Jan 2024 02:08:10 GMT, David Holmes <dholmes 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.

I have a couple of minor comments but looks good.

test/hotspot/jtreg/runtime/jni/abstractMethod/AbstractMethod.jasm line 43:

> 41:     public abstract Method "abstractM":"()V";
> 42: 
> 43: }

some newline missing.

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?

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

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17337#pullrequestreview-1813150220
PR Review Comment: https://git.openjdk.org/jdk/pull/17337#discussion_r1447340365
PR Review Comment: https://git.openjdk.org/jdk/pull/17337#discussion_r1447344481


More information about the hotspot-runtime-dev mailing list