[jdk18] RFR: 8279356: Method linking fails with guarantee(mh->adapter() != NULL) failed: Adapter blob must already exist! [v2]

Tobias Hartmann thartmann at openjdk.java.net
Tue Jan 11 07:02:55 UTC 2022


> 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/jdk18/blob/d65c665839c0a564c422ef685f2673fac37315d7/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/jdk18/blob/d65c665839c0a564c422ef685f2673fac37315d7/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

Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:

  Updated copyright

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

Changes:
  - all: https://git.openjdk.java.net/jdk18/pull/88/files
  - new: https://git.openjdk.java.net/jdk18/pull/88/files/e0ba3cfb..5c6e13d9

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk18&pr=88&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk18&pr=88&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk18/pull/88.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk18 pull/88/head:pull/88

PR: https://git.openjdk.java.net/jdk18/pull/88


More information about the hotspot-dev mailing list