PING^3: RFD: C2 bug: 8157306 random infrequent null pointer exceptions in javac
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Aug 18 03:10:38 UTC 2016
It was an other problem - implicit null check code moved a node above its control.
Here is fix I am testing now (in addition to previous change in lcm):
src/share/vm/opto/lcm.cpp
@@ -240,6 +240,14 @@
continue;
}
+ // Check that node's control edge is not-null block's head or dominates it,
+ // otherwise we can't hoist it because there are other control dependencies.
+ Node* ctrl = mach->in(0);
+ if (ctrl != NULL && !(ctrl == not_null_block->head() ||
+ get_block_for_node(ctrl)->dominates(not_null_block))) {
+ continue;
+ }
+
// check if the offset is not too high for implicit exception
{
intptr_t offset = 0;
@@ -379,9 +387,12 @@
block->add_inst(best);
map_node_to_block(best, block);
- // Move the control dependence
- if (best->in(0) && best->in(0) == old_block->head())
- best->set_req(0, block->head());
+ // Move the control dependence if it is pinned to not-null block.
+ // Don't change it in other cases: NULL or dominating control.
+ if (best->in(0) == not_null_block->head()) {
+ // Set it to control edge of null check.
+ best->set_req(0, proj->in(0)->in(0));
+ }
Thanks,
Vladimir
On 8/17/16 12:55 PM, Vladimir Kozlov wrote:
> I tested the fix and hit tests failures:
>
> # Internal Error (/opt/jprt/T/P1/013538.vkozlov/s/hotspot/src/share/vm/opto/gcm.cpp:417), pid=25539, tid=25645
> # assert(early->dominates(LCA)) failed: early is high enough
>
> V [libjvm.so+0xa67d0d] report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
> V [libjvm.so+0xcca62b] PhaseCFG::insert_anti_dependences(Block*, Node*, bool)+0x157b
> V [libjvm.so+0x69f909] PhaseCFG::verify() const+0x659
> V [libjvm.so+0x9da558] Compile::Code_Gen()+0x358
>
> I did not have time to analyze it yet.
>
> Vladimir
>
> On 8/17/16 9:56 AM, Andrew Haley wrote:
>> On 05/08/16 04:28, Vladimir Kozlov wrote:
>>> On 8/4/16 4:30 PM, Andrew Haley wrote:
>>>> On 04/08/16 04:35, Vladimir Kozlov wrote:
>>>>
>>>>> I can't reproduce the problem any more with latest hs-comp
>>>>> sources. Andrew, can you verify this fix?
>>>>
>>>> Yes, you're right.
>>>>
>>>> Wouldn't it make sense to surround that code with
>>>> ! needs_anti_dependence_check() ?
>>>
>>> Yes, we should do it.
>>
>> What do you want to do about this? It needs to go into jprt.
>>
>> Which means you, really.
>>
>> Andrew.
>>
>>
More information about the hotspot-compiler-dev
mailing list