Thanks. I took a quick look at it the other day and I think I know what the problem is.

-- Kevin


On 3/21/2019 8:16 AM, Anton Tarasov wrote:
Hi Kevin,

Please find it here: https://bugs.openjdk.java.net/browse/JDK-8221261

Regards,
Anton.

On 3/14/2019 7:23 PM, Kevin Rushforth wrote:
Hi Anton,

Can you file a bug in JBS? We can take a look at it, although it might be difficult without a test case.

-- Kevin


On 3/11/19 10:30 PM, Anton Tarasov wrote:
Hello!

Could you please take a look at the deadlock which we encounter with JFXPanel/WebView:

"AWT-EventQueue-0" prio=0 tid=0x0 nid=0x0 waiting on condition
     java.lang.Thread.State: WAITING
 on java.util.concurrent.FutureTask@51c6338d
    at java.base@11.0.2/jdk.internal.misc.Unsafe.park(Native Method)
    at java.base@11.0.2/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)     at java.base@11.0.2/java.util.concurrent.FutureTask.awaitDone(FutureTask.java:447)     at java.base@11.0.2/java.util.concurrent.FutureTask.get(FutureTask.java:190)     at platform/javafx.web@11.0.2/com.sun.javafx.webkit.InputMethodClientImpl.getLocationOffset(InputMethodClientImpl.java:157)     at platform/javafx.graphics@11.0.2/javafx.scene.Scene$InputMethodRequestsDelegate.getLocationOffset(Scene.java:4140)     at platform/javafx.swing@11.0.2/javafx.embed.swing.InputMethodSupport$InputMethodRequestsAdapter.getLocationOffset(InputMethodSupport.java:67)     at java.desktop@11.0.2/sun.awt.im.InputMethodContext.getLocationOffset(InputMethodContext.java:285)     at java.desktop@11.0.2/sun.lwawt.macosx.CInputMethod$7.run(CInputMethod.java:779)     at java.desktop@11.0.2/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)     at java.desktop@11.0.2/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)     at java.desktop@11.0.2/java.awt.EventQueue$4.run(EventQueue.java:727)     at java.desktop@11.0.2/java.awt.EventQueue$4.run(EventQueue.java:721)     at java.base@11.0.2/java.security.AccessController.doPrivileged(Native Method)     at java.base@11.0.2/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)     at java.base@11.0.2/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)     at java.desktop@11.0.2/java.awt.EventQueue$5.run(EventQueue.java:751)     at java.desktop@11.0.2/java.awt.EventQueue$5.run(EventQueue.java:749)     at java.base@11.0.2/java.security.AccessController.doPrivileged(Native Method)     at java.base@11.0.2/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)     at java.desktop@11.0.2/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)     at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:723)     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:672)     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:367)     at java.desktop@11.0.2/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)     at java.desktop@11.0.2/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)     at java.desktop@11.0.2/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)     at java.desktop@11.0.2/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)     at java.desktop@11.0.2/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)     at java.desktop@11.0.2/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

"JavaFX Application Thread" prio=0 tid=0x0 nid=0x0 runnable
     java.lang.Thread.State: RUNNABLE
 (in native)
    at java.desktop@11.0.2/sun.lwawt.macosx.LWCToolkit.$$YJP$$doAWTRunLoopImpl(Native Method)     at java.desktop@11.0.2/sun.lwawt.macosx.LWCToolkit.doAWTRunLoopImpl(LWCToolkit.java)     at java.desktop@11.0.2/sun.lwawt.macosx.LWCToolkit.doAWTRunLoop(LWCToolkit.java:1027)     at java.desktop@11.0.2/sun.lwawt.macosx.LWCToolkit.invokeAndWait(LWCToolkit.java:827)     at java.desktop@11.0.2/sun.lwawt.macosx.LWCToolkit.invokeAndWait(LWCToolkit.java:780)     at java.desktop@11.0.2/sun.lwawt.macosx.CInputMethod.characterIndexForPoint(CInputMethod.java:777)

It seems to be caused by this fix: https://hg.openjdk.java.net/openjfx/11/rt/rev/808d535c4e15

The "characterIndexForPoint" method performs "invokeAndWait" from JavaFX thread:

            LWCToolkit.invokeAndWait(new Runnable() {
                public void run() { synchronized(offsetInfo) {
                    offsetInfo[0] = fIMContext.getLocationOffset(screenX, screenY);                     insertPositionOffset[0] = fIMContext.getInsertPositionOffset();
                }}
            }, fAwtFocussedComponent);

which is then on EDT delegates back to JavaFX thread and waits for async result.

Is it a known issue? Unfortunately, I can't give you a simple case to reproduce it. Hope the problem looks clear from the description.

With best regards,
Anton.


Reply via email to