guarantee(PageArmed == 0) failed: invaliant
David Holmes
david.holmes at oracle.com
Tue Nov 25 07:04:20 UTC 2014
Hi Yasumasa,
On 25/11/2014 1:34 PM, Yasumasa Suenaga wrote:
> Hi all,
>
> My customer encountered crash with below messages:
> --------
> Internal Error (safepoint.cpp:309)
> guarantee(PageArmed == 0) failed: invaliant
> --------
> - JDK: JDK6u37 x64
> - OS: RHEL 5.4 x86_64
>
> I found similar issues in JBS:
> - JDK-7116986
> - JDK-7156454
> - JDK-8033717
>
> I read safepoint.cpp in jdk9, I guess this error is caused in below:
> --------
> if (int(iterations) == DeferPollingPageLoopCount) {
> guarantee (PageArmed == 0, "invariant") ;
> PageArmed = 1 ;
> os::make_polling_page_unreadable();
> }
> --------
>
> "iterations" is defined as "unsigned int", and increments in each loop.
> On the other hand, DeferPollingPageLoopCount is defined intx and default
> value is "-1" .
>
> "PageArmed" sets to 1.
> --------
> if (DeferPollingPageLoopCount < 0) {
> // Make polling safepoint aware
> guarantee (PageArmed == 0, "invariant") ;
> PageArmed = 1 ;
> os::make_polling_page_unreadable();
> }
> --------
>
>
> If "iterations" is overflowed, do we encounter this guarantee ?
> I think this "if" statement should rewrite as below:
No we want this overflow to trigger the guarantee failure - it indicates
a problem elsewhere in the VM because a thread is not reaching the
safepoint that has been requested, in a timely manner.
When crashes like this occur you need to examine all the running threads
to find out which are not safepoint-safe and then determine what they
are doing and why they have not performed a safepoint check.
David
------
> --------
> diff -r 7e08ae41ddbe src/share/vm/runtime/safepoint.cpp
> --- a/src/share/vm/runtime/safepoint.cpp Mon Nov 24 09:57:02 2014 +0100
> +++ b/src/share/vm/runtime/safepoint.cpp Tue Nov 25 12:19:58 2014 +0900
> @@ -288,7 +288,8 @@
> // 9. On windows consider using the return value from SwitchThreadTo()
> // to drive subsequent spin/SwitchThreadTo()/Sleep(N) decisions.
>
> - if (int(iterations) == DeferPollingPageLoopCount) {
> + if ((DeferPollingPageLoopCount >= 0) &&
> + (int(iterations) == DeferPollingPageLoopCount)) {
> guarantee (PageArmed == 0, "invariant") ;
> PageArmed = 1 ;
> os::make_polling_page_unreadable();
> --------
>
>
> If it is correct, I will file it to JBS and upload webrev.
> Could you help me to resolve this issue?
>
>
> Thanks,
>
> Yasumasa
>
More information about the hotspot-dev
mailing list