Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash inside GeneratedMethodAccessor #192

Open
aoli-al opened this issue Feb 17, 2023 · 0 comments
Open

Crash inside GeneratedMethodAccessor #192

aoli-al opened this issue Feb 17, 2023 · 0 comments

Comments

@aoli-al
Copy link
Contributor

aoli-al commented Feb 17, 2023

I notice phosphor crashes when executing the following code

    public static void main(String[] args) throws Throwable {
        int[] a = new int[] {1, 2, 4, 5, 6, 7, 8, 10};
        int[] b = new int[] {1, 2, 4, 5, 6, 7, 8, 10};
        for (int i = 0; i < 1000; i++) {
            Method m = Arrays.class.getMethod("equals", int[].class, int[].class);
            if ((Boolean) (m.invoke(null, a, b))) {
                System.out.println("true");
            } else {
                System.out.println("false");
            }
        }
    }

and the trace

Exception in thread "main" java.lang.IllegalArgumentException: java.lang.ClassCastException@387c703b                                                                                                                              
        at java.base/jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)                                                                                                                                         
        at java.base/jdk.internal.reflect.MethodAccessorImpl.invoke(MethodAccessorImpl.java)                                                                                                                                      
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                           
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)                                                                                                                                                             

I didn't look into this issue because I managed to workaround this by adding the flag -Dsun.reflect.inflationThreshold=99999 which prevents JDK from generating method accessors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant