[14] RFR(S): 8234616: assert(0 <= i && i < _len) failed: illegal index in PhaseMacroExpand::expand_macro_nodes()

Tobias Hartmann tobias.hartmann at oracle.com
Wed Dec 4 05:59:19 UTC 2019


Thanks Vladimir!

Best regards,
Tobias

On 03.12.19 19:18, Vladimir Kozlov wrote:
> +1
> 
> Vladimir K
> 
> On 12/3/19 7:16 AM, Vladimir Ivanov wrote:
>>
>>> http://cr.openjdk.java.net/~thartmann/8234616/webrev.00/
>>
>> Looks good.
>>
>> Best regards,
>> Vladimir Ivanov
>>
>>>
>>> We assert in PhaseMacroExpand::expand_macro_nodes() when accessing the macro_node array because
>>> 'macro_idx' is out of the upper bound:
>>> https://hg.openjdk.java.net/jdk/jdk/file/43c4fb8ba96b/src/hotspot/share/opto/macro.cpp#l2591
>>>
>>> The problem is that in the previous iteration, we hit the following code path which removes an
>>> unreachable macro node but does not decrement 'macro_idx':
>>> https://hg.openjdk.java.net/jdk/jdk/file/43c4fb8ba96b/src/hotspot/share/opto/macro.cpp#l2594
>>>
>>> The problem was introduced in JDK 14 by the fix for JDK-8227384:
>>> https://hg.openjdk.java.net/jdk/jdk/rev/43c4fb8ba96b#l3.25
>>>
>>> I've changed the loop to a for-loop to make sure the index is always decremented and also
>>> strengthened the asserts. I was not able to create a regression test but the issue reproduces
>>> intermittently with Lucene.
>>>
>>> Thanks,
>>> Tobias
>>>


More information about the hotspot-compiler-dev mailing list