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

Ioi Lam iklam at openjdk.org
Mon Dec 9 20:38:42 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.

This pull request has now been integrated.

Changeset: 0b9e749f
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/0b9e749f54f409b8ff904f6b253292012ee842b8
Stats:     10 lines in 2 files changed: 7 ins; 0 del; 3 mod

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

Reviewed-by: mbaesken, kbarrett

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

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


More information about the hotspot-runtime-dev mailing list