RFR: 8274785: ciReplay: Potential crash due to uninitialized Compile::_ilt variable
Christian Hagedorn
chagedorn at openjdk.java.net
Thu Oct 7 15:03:24 UTC 2021
While working on JDK-8272912 and inserting `assert(false)` on various places for testing purposes, I noticed the following segmentation fault in one case:
The inline tree `Compile::_ilt` variable is not initialized directly by the initializer list but only later in `Compile::Compile()` when calling
_ilt = InlineTree::build_inline_tree_root();
Before this assignment, `_ilt` can contain garbage (i.e. `!= NULL`). When hitting an assert or crash before returning from `build_inline_tree_root()`, replay compilation is trying to dump the inline tree and fails to notice that the inline tree is still uninitialized. This can result in a segmentation fault when accessing `_ilt`.
Thanks,
Christian
-------------
Commit messages:
- 8274785: ciReplay: Potential crash due to uninitialized Compile::_ilt variable
Changes: https://git.openjdk.java.net/jdk/pull/5852/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5852&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8274785
Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/5852.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5852/head:pull/5852
PR: https://git.openjdk.java.net/jdk/pull/5852
More information about the hotspot-compiler-dev
mailing list