[10] RFR(S): 8181644: C1 crashes with -XX:+PrintCFGToFile

Tobias Hartmann tobias.hartmann at oracle.com
Wed Jun 7 10:21:48 UTC 2017

Hi Vladimir,

On 06.06.2017 16:55, Vladimir Kozlov wrote:
> May be use guarantee instead of assert in cfg_printer_output() to avoid parfait complains? Or add NULL check in all callers.

I think parfait only cares about code available in product builds but a guarantee doesn't hurt here.

I'll push this version:


> On 6/6/17 5:47 AM, Tobias Hartmann wrote:
>> Hi,
>> please review the following patch:
>> https://bugs.openjdk.java.net/browse/JDK-8181644
>> http://cr.openjdk.java.net/~thartmann/8181644/webrev.00/
>> C1 crashes in CFGPrinterOutput::print_LIR() when PrintCFGToFile is enabled. The problem is that a single CFGPrinterOutput object is shared between multiple C1 compiler threads leading to inconsistent values of CFGPrinterOutput::_do_print_LIR. One thread sets _do_print_LIR to 'true' while another thread expects it to be 'false' because the LIR is not available in the current phase. We crash while trying to dereference BlockBegin::_lir which is NULL.
>> I changed the implementation to create a CFGPrinterOutput object per C1 compilation (I had to move the declaration of CFGPrinterOutput from the cpp to the hpp file). Instead of a single "output.cfg" file, now one file per compiler thread is generated ("output_tid[TID]_pid[PID].cfg").
>> Tested manually with -Xcomp and -XX:+PrintCFGToFile.
>> Thanks,
>> Tobias

More information about the hotspot-compiler-dev mailing list