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

Daniel Jeliński djelinski at openjdk.org
Wed Sep 27 07:34:27 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.

This pull request has now been integrated.

Changeset: fd52be2a
Author:    Daniel Jeliński <djelinski at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/fd52be2a3c53912598afe600d680de77090f9f43
Stats:     5 lines in 1 file changed: 0 ins; 1 del; 4 mod

8316895: SeenThread::print_action_queue called on a null pointer

Reviewed-by: coleenp, dholmes

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

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


More information about the hotspot-runtime-dev mailing list