-
Bug
-
Resolution: Fixed
-
P4
-
8u40, 9
-
b42
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8083233 | emb-9 | Aleksey Shipilev | P4 | Resolved | Fixed | team |
(synopsis is probably incomplete, please change as you see fit)
Originally reported by Tom Deneau on jmh-dev, and then on hotspot-runtime-dev:
http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2014-November/013216.html
The problems seems to be when one thread is busy-waiting on global volatile flag,
and another thread sleeps for a given time, and then sets the flag. We can deadlock on
safepoint rendezvous, when "sleeper" thread had reached the safepoint, but "worker" is not
reaching safepoint, blocking progress.
Reproducible test:
http://cr.openjdk.java.net/~shade/8064749/Stuck.java
$ java Stuck
(exits after 5 seconds)
$ java -XX:-UseCompilerSafepoints Stuck
(waits indefinitely, does not react to jstack -F, SIGINT, etc.)
$ java -XX:-UseCompilerSafepoints -XX:+SafepointTimeout Stuck
("Worker" thread is stuck)
# SafepointSynchronize::begin: Timeout detected:
# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.
# SafepointSynchronize::begin: Threads which did not reach the safepoint:
# "Worker" #9 prio=5 os_prio=0 tid=0x00007feddc0db800 nid=0x19f0 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
# SafepointSynchronize::begin: (End of list)
Originally reported by Tom Deneau on jmh-dev, and then on hotspot-runtime-dev:
http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2014-November/013216.html
The problems seems to be when one thread is busy-waiting on global volatile flag,
and another thread sleeps for a given time, and then sets the flag. We can deadlock on
safepoint rendezvous, when "sleeper" thread had reached the safepoint, but "worker" is not
reaching safepoint, blocking progress.
Reproducible test:
http://cr.openjdk.java.net/~shade/8064749/Stuck.java
$ java Stuck
(exits after 5 seconds)
$ java -XX:-UseCompilerSafepoints Stuck
(waits indefinitely, does not react to jstack -F, SIGINT, etc.)
$ java -XX:-UseCompilerSafepoints -XX:+SafepointTimeout Stuck
("Worker" thread is stuck)
# SafepointSynchronize::begin: Timeout detected:
# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.
# SafepointSynchronize::begin: Threads which did not reach the safepoint:
# "Worker" #9 prio=5 os_prio=0 tid=0x00007feddc0db800 nid=0x19f0 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
# SafepointSynchronize::begin: (End of list)
- backported by
-
JDK-8083233 -XX:-UseCompilerSafepoints breaks safepoint rendezvous
-
- Resolved
-
- duplicates
-
JDK-8064776 Remove -XX:+-UseCompilerSafepoints flag
-
- Closed
-