[9] RFR(S): 8142500: missing null checks in IfNode::has_only_uncommon_traps

Tobias Hartmann tobias.hartmann at oracle.com
Fri Nov 13 11:32:17 UTC 2015


Thanks, Vladimir.

On 13.11.2015 08:46, Vladimir Kozlov wrote:
> Top method (one which is compiled) has _caller == NULL.
> (An other place GraphKit::transfer_exceptions_into_jvms() but that one should be merged at the end of method parsing).
> 
> It would be nice if you say what exact case you have in this bug.

The bug shows up in the following setting: The method 'dom_method' containing the dominating uncommon trap is the top method (not inlined, _caller == NULL). However, the method 'method' containing the dominated uncommon trap is inlined (_caller != NULL). Since we check that both methods are equal this can only happen if the method inlines itself recursively.

I tried but I was not able to create a regression test for this. However, Tom Rodriguez verified that the fix solves the problem.

> The added code is correct but the comment is confusing because *caller* has to be inlined if we are processing a callee.

I agree that the comment is a bit misleading. With "methods" I meant 'method' and 'dom_method' for which we check equality before. I changed the comment to:

810 // The current method must either be inlined into both dom_caller
811 // and caller or must not be inlined at all. Bail out otherwise.

New webrev:
http://cr.openjdk.java.net/~thartmann/8142500/webrev.01

Best,
Tobias

> On 11/12/15 11:08 PM, Tobias Hartmann wrote:
>> Hi,
>>
>> please review the following patch:
>>
>> https://bugs.openjdk.java.net/browse/JDK-8142500
>> http://cr.openjdk.java.net/~thartmann/8142500/webrev.00/
>>
>> C2 crashes in 'IfNode::has_only_uncommon_traps()' after calling 'dom_caller->same_calls_as(caller)' because 'dom_caller' or 'caller' is NULL. This may happen if the method containing the corresponding uncommon trap is not inlined and therefore has no caller in its JVMState. We should bail out if either 'dom_caller' or 'caller' is NULL (it's fine if both are NULL).
>>
>> Since we check that the uncommon traps belong to the same method, this can only happen if the method is recursively inlined.
>>
>> Tom Rodriguez verified that this solves the problem.
>>
>> Thanks,
>> Tobias
>>


More information about the hotspot-compiler-dev mailing list