RFR: 8347422: Crash during safepoint handler execution with -XX:+UseAPX
Jatin Bhateja
jbhateja at openjdk.org
Thu Jan 16 12:13:38 UTC 2025
On Mon, 13 Jan 2025 14:34:40 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>>> Thanks Jatin. In this case I would suggest that we should add a VM stress flag to give preference to EGPRs, or maybe [JDK-8343294](https://bugs.openjdk.org/browse/JDK-8343294) is good enough?
>>>
>>
>> Technically, randomizing allocation sequence from the same register class is not very useful from the compiler standpoint as it simply ensures that an LRG corresponding to the definition MachOper is never assigned the same register which is already assigned to its neighbors in the interference graph, so it simply picks the next available free register while choosing the color, a change in allocation order will not impact the spilling behavior either, what I am doing is modifying the static allocation order so that we deterministically give preferences to EGPRs over GPRs, this will ensure that all our APX specific assembler support and special handling like the one extended by this patch as exercised throughly.
>>
>>> Do the existing tests trigger this even without `-XX:+SafepointALot`?
>>
>> Yes, but with -XX:+SafepointALot crash hit early.
>
>> Technically, randomizing allocation sequence from the same register class is not very useful
>
> It's definitely useful to catch bugs where silent register corruption is never detected because that exact register is not used anywhere else. Or for cases where a specific register is not saved although it should be but we don't notice because that register is not used anywhere else. And we had quite a few bugs like this in the past.
>
> Wouldn't such a random register selection also randomly prioritize EGPRs and therefore do the same thing that you did manually? And if not, doesn't that mean that we should definitely add such a stress flag?
>
>> Yes, but with -XX:+SafepointALot crash hit early.
>
> Okay, good then.
Hi @TobiHartmann , Please let me know if fix looks ok, JDK-8343294 will be a separate RFE.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23035#issuecomment-2595372364
More information about the hotspot-compiler-dev
mailing list