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

Kim Barrett kbarrett at openjdk.org
Thu Dec 5 09:23:38 UTC 2024


On Wed, 4 Dec 2024 20:36:29 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> (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.

Looks good.

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

Marked as reviewed by kbarrett (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22560#pullrequestreview-2481031942


More information about the hotspot-runtime-dev mailing list