[15] RFR(XS): 8239069: C2: SIGSEGV in IdealGraphPrinter::walk_nodes due to C->root() being NULL

Christian Hagedorn christian.hagedorn at oracle.com
Fri Feb 14 09:56:41 UTC 2020


Hi

Please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8239069
http://cr.openjdk.java.net/~chagedorn/8239069/

This happens for the method in the replay file because C2 calls 
Compile::record_failure() twice consecutively which calls 
Compile::print_method() each time. In the first call of 
Compile::record_failure(), it sets _root to NULL after printing the 
ideal graph [1]. In the second call of Compile::record_failure(), it 
calls Compile::print_method() again. But this time C->root() is NULL. As 
a result, it crashes later at [2] when trying to dereference 'start' 
which is C->root() and therefore NULL.

The fix is straight forward to not print the ideal graph if the root 
node to start the printing is NULL. This crash only happens in rare cases.


Thank you!

Best regards,
Christian


[1] 
http://hg.openjdk.java.net/jdk/jdk/file/f82f59ef79f0/src/hotspot/share/opto/compile.cpp#l3940
[2] 
http://hg.openjdk.java.net/jdk/jdk/file/f82f59ef79f0/src/hotspot/share/opto/idealGraphPrinter.cpp#l622


More information about the hotspot-compiler-dev mailing list