RFR: JDK-8323190: Segfault during deoptimization of C2-compiled code

Christian Hagedorn chagedorn at openjdk.org
Wed Jan 10 09:02:22 UTC 2024


On Wed, 10 Jan 2024 01:22:37 GMT, Cesar Soares Lucas <cslucas at openjdk.org> wrote:

> Currently, if `ReduceAllocationMerges` reduces an allocation merge that is used as a monitor C2 will SIGFAULT in `Process_OopMap_Node` because it's missing code to handle that case.  This patch fixes C2 to properly handle reduced allocation merges that are used as monitors. 
> 
> Tested with Linux x86_64 hotspot_all.

src/hotspot/share/opto/output.cpp line 1092:

> 1090:         ObjectMergeValue* mv = (ObjectMergeValue*) sv_for_node_id(objs, smerge->_idx);
> 1091: 
> 1092:         if (mv == NULL) {

You should replace `NULL` with `nullptr` here and below. This also seems wrong here where you took the code from:
https://github.com/openjdk/jdk/blob/88378ed0584c7eb0849b6fc1e361fd8ea0698caf/src/hotspot/share/opto/output.cpp#L775-L796

On a separate note, the code looks almost identical. Could it be shared somehow?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17333#discussion_r1447068114


More information about the hotspot-compiler-dev mailing list