Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8238505

[macOS] Intermittent deadlock on exit in MacTimer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • jfx24
    • 8u212, jfx15
    • javafx
    • macOS 10.13.6
      JDK 13.0.1
      OpenJFX 15-ea (but could just as easily happen on openjfx14)

      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.

            arapte Ambarish Rapte
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: