RFR: 8316895: SeenThread::print_action_queue called on a null pointer

David Holmes dholmes at openjdk.org
Tue Sep 26 21:27:11 UTC 2023


On Tue, 26 Sep 2023 17:24:40 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> This patch fixes a crash in `test/hotspot/jtreg/runtime/logging/RedefineClasses.java` when the code is compiled without `-fno-delete-null-pointer-checks`.
> 
> The test crashes because the method `print_action_queue` is called on a null object reference, which leads to undefined behavior. Some C++ compilers take that as a permission to assume that `this` is never null and remove all such checks.
> 
> The patch simply changes `print_action_queue` to a static method taking a pointer to what was formerly `this`. There's not much that could possibly go wrong.
> 
> Should I add the bug ID to `test/hotspot/jtreg/runtime/logging/RedefineClasses.java`? The existing code does not crash now; it would only start crashing after [JDK-8316893](https://bugs.openjdk.org/browse/JDK-8316893) is addressed.

Looks fine.

Thanks

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15932#pullrequestreview-1645230700


More information about the hotspot-runtime-dev mailing list