Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7u10, 8
    • Fix Version/s: tbd_major
    • Component/s: javafx
    • Environment:

      Mac OS X

      Description

      We seem to run into native locks on Mac's AWT implementation, in combination with Swing and embedded JavaFX. Code which is working on Windows, and - as far as tested - on Linux, deadlocks on Mac. In these cases, a thread dump does not show a Java level deadlock, hence the idea about native deadlocks. This is especially the case with awt cursor methods. We have seen this also with drag-and-drop operations (failing on Mac only).

      Here is a reproducible testcase: a jframe with button, button-click shows a jdialog with jfxpanel. The jfxpanel has a button to close the jdialog via invokeAndWait, using setVisible(false) and dispose. This works on Windows. On Mac, the application freezes when clicking the close button in the jdialog/jfxpanel. See comment below for the test code (attachment still don't seem to work). I am also adding comments with stackdumps.

      About the "native deadlocks", here's some reasoning as to why we think that this might be the cause.

      1. FX thread holds cocoa lock when dispatching.
      2. FX thread calls SwingUtilities.invokeAndWait - waiting for EDT.
      3. EDT tries to get cursor position and is blocked by cocoa lock.

      static void perform_dispatch(JNIEnv *env, ... {
        JNF_COCOA_ENTER(env);
       ...

        JNF_COCOA_ENTER(blockEnv);
        ...
          // call the user's runnable
          JNFCallObjectMethod(blockEnv, [wrappedRunnable jObject], jm_run);

       ...
      }

      versus

      JNIEXPORT jobject JNICALL
      Java_sun_lwawt_macosx_CCursorManager_nativeGetCursorPosition(... {
        ...
        JNF_COCOA_ENTER(env);
        ...

        Activity

        wlehmann Werner Lehmann created issue -
        art Artem Ananiev made changes -
        Field Original Value New Value
        Status New [ 10000 ] Open [ 1 ]
        art Artem Ananiev made changes -
        Environment 1.7u10 on OSX Mac OS X
        Labels jfxpanel swing deadlock threading
        Affects Version/s Lombard [ 10380 ]
        ant Anton Tarasov made changes -
        Fix Version/s Van Ness [ 10750 ]
        jgodinez Jennifer Godinez (Inactive) made changes -
        Assignee Artem Ananiev [ art ]
        duke J. Duke (Inactive) made changes -
        Component/s javafx [ 12520 ]
        Component/s Swing [ 10060 ]
        duke J. Duke (Inactive) made changes -
        Workflow jfxc-workflow-v2 [ 88642 ] JBS Workflow [ 124795 ]
        squierts Tony Squier made changes -
        Project Import Fri Jun 12 21:05:53 UTC 2015 [ 1434143153521 ]
        squierts Tony Squier made changes -
        Project Runtime [ 11000 ] JDK [ 10100 ]
        Key RT-31124 JDK-8087465
        Fix Version/s 9 [ 14949 ]
        Fix Version/s 9 [ 17733 ]
        Affects Version/s 7u10 [ 12544 ]
        Affects Version/s 8 [ 11815 ]
        Affects Version/s 7u10 [ 17719 ]
        Affects Version/s 8 [ 17730 ]
        Imported 12/Jun/15 3:28 PM
        Component/s javafx [ 11900 ]
        Component/s javafx [ 12124 ]
        squierts Tony Squier made changes -
        Subcomponent swing [ 1510 ] swing [ 1388 ]
        jgodinez Jennifer Godinez (Inactive) made changes -
        Fix Version/s tbd_major [ 11972 ]
        Fix Version/s 9 [ 14949 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            wlehmann Werner Lehmann
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Imported: