RFR: 8345390: [ubsan] systemDictionaryShared.cpp:964: member call on null pointer

Ioi Lam iklam at openjdk.org
Wed Dec 4 20:42:54 UTC 2024


(For JDK 25).

It's possible for the  `member_method` parameter to be `nullptr`. Since `member_method->is_shared()` only checks the range of `this` and doesn't dereference it, we don't have a crash, and the problem was found only when running with ubsan.

However, the code was wrong, as `((Method*)nullptr)->is_shared()` would return `false`, making it impossible to load the archived Lambda class.

After the fix, I modified the test case to ensure that the Lambda class can be correctly loaded from the archive.

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

Commit messages:
 - 8345390: [ubsan] systemDictionaryShared.cpp:964: member call on null pointer

Changes: https://git.openjdk.org/jdk/pull/22560/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22560&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8345390
  Stats: 10 lines in 2 files changed: 7 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/22560.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22560/head:pull/22560

PR: https://git.openjdk.org/jdk/pull/22560


More information about the hotspot-runtime-dev mailing list