RFR: 8279356: Method linking fails with guarantee(mh->adapter() != NULL) failed: Adapter blob must already exist!
Vladimir Kozlov
kvn at openjdk.java.net
Fri Jan 7 21:41:23 UTC 2022
On Fri, 7 Jan 2022 16:57:03 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> Adapter creation during method linking may fail due to a lack of code cache space which leads to a `VirtualMachineError` being thrown and thus a bail out from linking the holder klass:
> https://github.com/openjdk/jdk/blob/4243f4c998344e77dccd4d5605e56e869bc8af89/src/hotspot/share/oops/method.cpp#L1239-L1247
>
> If the `VirtualMachineError` is handled/ignored by the application, we may later attempt to link the same klass and therefore also the same method again. We then incorrectly bail out from adapter creation because the `_i2i_entry` is set, assuming that this can only happen if adapters have already been created. However, that is not guaranteed because the interpreter entry is set right **before** adapters are created:
> https://github.com/openjdk/jdk/blob/4243f4c998344e77dccd4d5605e56e869bc8af89/src/hotspot/share/oops/method.cpp#L1213-L1230
>
> I propose to instead check if adapters have been created.
>
> This is an old bug that was just recently triggered by an unrelated change.
>
> Thanks,
> Tobias
Seems reasonable.
-------------
Marked as reviewed by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6990
More information about the hotspot-dev
mailing list