RFR: 8315890: Attempts to load from nullptr in instanceKlass.cpp and unsafe.cpp [v2]

David Holmes dholmes at openjdk.org
Wed Nov 1 02:04:07 UTC 2023


On Mon, 30 Oct 2023 20:19:45 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> Calls in instanceKlass.cpp and unsafe.cpp try to call an atomic load on method calls that could return nullptr. This patch ensures that nullptr is not passed into the load. 
>> 
>> In `print_as_native_pointer` in archiveBuilder, `source_obj_to_requested_obj` should not be able to return `nullptr` as the result is immediately cast to an oop which cascades down to the failure reported in  `get_volatile()` in `unsafe.cpp`. Placing an assert close to the top of this call stack should prevent this from happening and will better indicate the source of an unexpected `nullptr` should it occur.
>> 
>> Verified with tier1-5 tests.
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Moved assert higher in call stack

Okay. Thanks

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16405#pullrequestreview-1707471870


More information about the hotspot-dev mailing list