RFR: 8267213: assert(left >= right) failed: avoid underflow [v3]

Jie Fu jiefu at openjdk.java.net
Tue May 18 07:32:41 UTC 2021


On Mon, 17 May 2021 09:39:18 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> Hi all,
>> 
>> This is a follow-up of JDK-8260046.
>> And it can be reproduced by `java -XX:UnguardOnExecutionViolation=1` on x86_32.
>> Let's fix it
>> 
>> Thanks.
>> Best regards,
>> Jie
>
> Jie Fu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove if

> _Mailing list message from [David Holmes](mailto:david.holmes at oracle.com) on [hotspot-dev](mailto:hotspot-dev at mail.openjdk.java.net):_
> 
> Hi Jie,
> 
> On 18/05/2021 9:14 am, Jie Fu wrote:
> 
> > On Mon, 17 May 2021 22:27:16 GMT, David Holmes <david.holmes at oracle.com> wrote:
> > > I would expect pc to point to start of jmp instruction and addr to point
> > > later.
> > 
> > 
> > OK.
> > If so, the original code is right and the lasted fix just follows what it does before.
> > Thanks.
> 
> I don't know how this "pc is near addr" check ends up affecting the
> assert(left >= right) but presumably we are hitting a case where the
> addr is in fact < pc. So the question is then whether that should be
> considered "near" or not. Your original fix decided "near" means within
> 15 in either direction; while under an expectation that addr >= pc, the
> current fix only consider it near within +15.
> 
> Have you analysed the original crash to check what the actual pc and
> addr values were?
> 
> Thanks,
> David

The crash case should not be considered "near" since addr = 0x0, pc = 0xe66095e6.
It seems like a harmless false-positive check [1].

And the stack is like this:

Current thread (0xf5817218):  JavaThread "Unknown thread" [_thread_in_vm, id=41005, stack(0xf5907000,0xf5958000)]

Stack: [0xf5907000,0xf5958000],  sp=0xf59559f0,  free space=314k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1103c98]  PosixSignals::pd_hotspot_signal_handler(int, siginfo_t*, ucontext_t*, JavaThread*)+0x588
V  [libjvm.so+0x137209e]  JVM_handle_linux_signal+0x14e
V  [libjvm.so+0x1372313]  javaSignalHandler(int, siginfo_t*, void*)+0x23

Registers:
EAX=0xf779b000, EBX=0xf74c5ae8, ECX=0xf5817218, EDX=0xf753791c
ESP=0xf59559f0, EBP=0xf5955a58, ESI=0xe66095e6, EDI=0x00000000
EIP=0xf6b67c98, EFLAGS=0x00210213, CR2=0x00000000f779b000


Thanks.

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp#L344

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

PR: https://git.openjdk.java.net/jdk/pull/4044


More information about the hotspot-dev mailing list