JDK-8238505 : [macOS] Intermittent deadlock on exit in MacTimer
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u212,jfx15
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • Submitted: 2020-02-04
  • Updated: 2024-03-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx23Unresolved
Related Reports
Relates :  
Relates :  
Description
I got a one-time deadlock on exit.

The PulseTimer-CVDisplayLink thread was calling Timer::pause at the same time the Glass/Prism Shutdown Hook thread was calling Timer::stop. The pause method was added as part of the fix for JDK-8189926.

I note that this particular deadlock can only happen if the application calls System.exit without first calling Platform::exit, since that is the only case in which the shutdown hook is run.

Here is the relevant information from the threads in question:

"PulseTimer-CVDisplayLink thread" #15 daemon prio=5 os_prio=31 cpu=26.53ms elapsed=540.17s tid=0x00007f8cc1454000 nid=0x14703 waiting for monitor entry  [0x00007000079f1000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.sun.glass.ui.Timer.pause(javafx.graphics/Timer.java:142)
	- waiting to lock <0x000000070eb0ee70> (a com.sun.glass.ui.mac.MacTimer)
	at com.sun.javafx.tk.quantum.QuantumToolkit.pauseTimer(javafx.graphics/QuantumToolkit.java:502)
	- locked <0x000000070eee9fe8> (a com.sun.javafx.tk.quantum.QuantumToolkit)
	at com.sun.javafx.tk.quantum.QuantumToolkit.postPulse(javafx.graphics/QuantumToolkit.java:489)
	at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$12(javafx.graphics/QuantumToolkit.java:345)
	at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$122/0x0000000800b8b840.run(javafx.graphics/Unknown Source)


"Glass/Prism Shutdown Hook" #12 prio=5 os_prio=31 cpu=1.81ms elapsed=539.93s tid=0x00007f8cc0b7e000 nid=0xdc0f runnable  [0x0000700007d7d000]
   java.lang.Thread.State: RUNNABLE
	at com.sun.glass.ui.mac.MacTimer._stop(javafx.graphics/Native Method)
	at com.sun.glass.ui.Timer.stop(javafx.graphics/Timer.java:131)
	- locked <0x000000070eb0ee70> (a com.sun.glass.ui.mac.MacTimer)
	at com.sun.javafx.tk.quantum.QuantumToolkit.dispose(javafx.graphics/QuantumToolkit.java:842)
	at com.sun.javafx.tk.quantum.QuantumToolkit$1.run(javafx.graphics/QuantumToolkit.java:253)

The complete stack dump is attached.
Comments
We are seeing this more frequently on our nightly and on-demand headful test jobs.
20-03-2024

I ran into this a couple more times today during local testing. Bumping to P3.
26-02-2020

I have only seen this once, and the code in question in the shutdown hook is only called when System.exit is called, so I made this a P4. If it can be reproduced with some regularity we can bump it to P3.
04-02-2020