<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
According to the remark in InvokeInputMethodFunction we shouldn’t use async calls like PostMessage() if Drag’n’Drop operation is active. If I got it right in problem case we entered to Drag’nDrop operation right after we started waiting on the InputMethod event
object in InvokeInputMethodFunction. I suspect some lack of synchronisation takes place. Perhaps we need to drop and reschedule the InputMethod events that are in progress before we enter Drag’n’Drop.
<div><br>
</div>
<div>Dmitrii <br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 7 Aug 2024, at 21:16, SWinxy <swinxythecat@gmail.com> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">This appears to be a deadlock. I've been able to replicate it, but it's annoyingly finicky to get it to freeze. A thread gets stuck on WaitForSingleObject at awt_Toolkit.cpp#L3139 (in AwtToolkit::InvokeInputMethodFunction) waiting for an object
to be signaled, but the signalling gets lost. And so it waits indefinitely.
<div><br>
</div>
<div>dmarkov, do you know more? A possible solution would be to change the timeout to be 1000ms, but that may have unintended effects.<br>
<br>
SWinxy</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Aug 5, 2024 at 5:23 AM Reto Merz <<a href="mailto:reto.merz@abacus.ch" target="_blank">reto.merz@abacus.ch</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hello,<br>
<br>
Our customers are using Drag & Drop functionality more and more<br>
and reports are increasing that our application is haning.<br>
It starts to escalate since the only workaround is to restart the app right now.<br>
<br>
The problem is already reported with JDK-8305479 [1]<br>
<br>
Is there any way to increase the priority of that issue<br>
or is a developer here we can hire to search for a fix (and create a pull request)?<br>
<br>
Btw, the bug is much easier to reproduce:<br>
<br>
1) Start the demo app (see [1])<br>
2) try to drop a document (eg: pdf file) from the windows desktop into the textfield<br>
<br>
Repeat step 2 if necessary. For me after 1-2 try this will cause the hang.<br>
If not, move the JFrame to another position and repeat step 2 again.<br>
<br>
Tested with latest JDK:<br>
java version "22.0.2" 2024-07-16<br>
Java(TM) SE Runtime Environment (build 22.0.2+9-70)<br>
Java HotSpot(TM) 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)<br>
<br>
OS MS Windows:<br>
Microsoft Windows [Version 10.0.17763.5458]<br>
<br>
Regards<br>
Reto Merz<br>
<br>
[1] <a href="https://bugs.openjdk.org/browse/JDK-8305479" rel="noreferrer" target="_blank">
https://bugs.openjdk.org/browse/JDK-8305479</a><br>
<br>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>