RFR: 8274785: ciReplay: Potential crash due to uninitialized Compile::_ilt variable
Nils Eliasson
neliasso at openjdk.java.net
Thu Oct 7 18:23:06 UTC 2021
On Thu, 7 Oct 2021 14:52:57 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> 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
Good!
-------------
Marked as reviewed by neliasso (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5852
More information about the hotspot-compiler-dev
mailing list