RFR: 8343756: CAN_SHOW_REGISTERS_ON_ASSERT for Windows [v4]

Martin Doerr mdoerr at openjdk.org
Mon Nov 25 15:01:20 UTC 2024


On Mon, 25 Nov 2024 14:41:34 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

>> src/hotspot/os/posix/os_posix.cpp line 2219:
>> 
>>> 2217:   // In the copied version, fpregs should point to the copied contents.
>>> 2218:   // Sanity check: fpregs should point into the context.
>>> 2219:   if ((address)((const ucontext_t*)ucVoid)->uc_mcontext.fpregs > (address)ucVoid) {
>> 
>> Maybe check that the address is larger than ucVoid but smaller than `ucVoid + sizeof(ucontext_t)`?
>> 
>> ```c++
>>   const ucontext_t* uc = (const ucontext_t*)ucVoid;
>>   if (uc->uc_mcontext.fpregs >= (uintptr_t)uc && 
>>       uc->uc_mcontext.fpregs < (uintptr_t)(uc + 1)) {
>>   }
>
> This is existing code that someone else wrote. It's also Linux-specific. I have only moved the existing logic.
> 
> I prefer not to touch this.

The check is done below.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21994#discussion_r1856764701


More information about the hotspot-dev mailing list