RFR: 8316895: SeenThread::print_action_queue called on a null pointer
Daniel Jeliński
djelinski at openjdk.org
Tue Sep 26 18:43:27 UTC 2023
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.
-------------
Commit messages:
- Fix print_action_queue
Changes: https://git.openjdk.org/jdk/pull/15932/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15932&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8316895
Stats: 5 lines in 1 file changed: 0 ins; 1 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/15932.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/15932/head:pull/15932
PR: https://git.openjdk.org/jdk/pull/15932
More information about the hotspot-runtime-dev
mailing list