Invalid code generated by C2 compiler in OpenJDK 21
Volker Simonis
volker.simonis at gmail.com
Fri Dec 15 17:44:05 UTC 2023
On Fri, Dec 15, 2023 at 1:11 PM Antoine DESSAIGNE
<antoine.dessaigne at gmail.com> wrote:
>
> Thank you Volker and Andrew for your replies,
>
> Unfortunately, there's no hs_error generated, the code throws a
> NullPointerException when it shouldn't.
Sorry, overlooked the "without" before "crashing due to assertions" :)
>
> I can even reproduce it with JDK 23, I took the master of the jdk
> repository this morning (commit b31454e3623 to be precise) and it
> still fails.
>
> I cannot exclude this method from the JIT as it's used a lot in our application.
>
> I checked many many times the commit to be sure that I have the right
> one and I do. It fails almost every time with 10737e168c9 [1] but it
> never fails with its parent commit, even after 20 tests.
>
The change looks innocent, but CCing hotstpo-runtime-dev and Coleen
(who's the author of that change [1]). Maybe she has an idea?
Is your code doing a lot of dynamic class loading and/or bytecode
instrumentation/rewriting?
> [1] https://github.com/openjdk/jdk/commit/10737e168c967a08e257927251861bf2c14795ab
>
> Le ven. 15 déc. 2023 à 12:37, Andrew Haley
> <aph-open at littlepinkcloud.com> a écrit :
> >
> > On 12/15/23 10:20, Antoine DESSAIGNE wrote:
> > > Do you have an idea of why this is happening? Do you know what test I
> > > can run?
> >
> > First, try to reproduce it with JDK 22 preview.
> >
> > If you can't provide a reproducer, it's likely that no one will be
> > able to fix it now, and you'll have to wait until it gets fixed.
> >
> > Try: '-XX:CompileCommand=exclude,foo.bar.baz.Classname::badMethodName'
> >
> > --
> > Andrew Haley (he/him)
> > Java Platform Lead Engineer
> > Red Hat UK Ltd. <https://www.redhat.com>
> > https://keybase.io/andrewhaley
> > EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
> >
More information about the hotspot-compiler-dev
mailing list