RFR: 8316895: SeenThread::print_action_queue called on a null pointer
Daniel Jeliński
djelinski at openjdk.org
Wed Sep 27 07:34:26 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.
Thanks for the reviews!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15932#issuecomment-1736854056
More information about the hotspot-runtime-dev
mailing list