RFR: 8261354: SIGSEGV at MethodIteratorHost

Jaroslav Bachorik jbachorik at openjdk.java.net
Fri May 21 10:58:00 UTC 2021


The `MethodIteratorHost` will iterate over previous versions of redefined classes but the number of methods in that class is retrieved only for the current version. 
Since the previous versions may theoretically, and before JDK 15 also practically, contain fewer methods than the current version (hotspot did support adding `private static` methods during retransformation) this can lead to SIGSEGV when the iterator tries accessing out-of-range method element.

Although for after JDK 15 it is not possible to have differing number of methods between multiple versions of a retransformed class it feels right not to rely on the implementation detail and re-retrieve the number of methods per each class version.

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

Commit messages:
 - 8261354: SIGSEGV at MethodIteratorHost

Changes: https://git.openjdk.java.net/jdk/pull/4143/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4143&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261354
  Stats: 4 lines in 1 file changed: 2 ins; 2 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4143.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4143/head:pull/4143

PR: https://git.openjdk.java.net/jdk/pull/4143


More information about the hotspot-jfr-dev mailing list