JDK-8321950 : Swing applications packaged with JPackage never become input idle
  • Type: Bug
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: 21
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2023-12-05
  • Updated: 2024-02-29
  • Resolved: 2023-12-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.
JDK 23
23Resolved
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Windows 11, issue also reproduces on Windows 10. Affects all tested JDK versions from 17 onward

A DESCRIPTION OF THE PROBLEM :
Swing applications packaged with JPackage never become input idle according to Windows. Any process waiting for the Java application to be properly started hangs until the wait timeouts

REGRESSION : Last worked in version 16

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Start a process using an exe created with jpackage. Use WaitForInputIdle to wait for said process to be ready to process input.

In JDK 14-16, the process becomes idle after a few hundred milliseconds. On JDK 17+, the process never becomes idle and all waits time out

I  have created a reproducer at https://github.com/lwahonen/waitfor_jdk_repro

Use buildrepro.cmd to build the jars/exes needed to reproduce, use reproduce.cmd to reproduce the issue.

The java source is just a simple Swing Hello World, the c++ source is a minimal example of waiting for a process to start

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The WaitForInputIdle call returns in under one second with return value 0 (Wait succeeded)
ACTUAL -
The WaitForInputIdle times out after 30 seconds (defined in WaitFor.cpp), and returns 258 ( WAIT_TIMEOUT )

---------- BEGIN SOURCE ----------
https://github.com/lwahonen/waitfor_jdk_repro
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Do not wait indefinitely for JVM to start, abort the wait after a fixed time and hope the process started correctly

FREQUENCY : always



Comments
[~asemenyuk] The submitter has requested for a backport to LTS (Preferably JDK 21)
29-02-2024

Dup of JDK-8294699. Same root cause. The fix confirmed by the submitter
20-12-2023

The submitter confirmed that the JDK 23 build with the fix works.
20-12-2023

Requested the submitter to try the same with JDK 23
14-12-2023

Likely to have the same root cause as JDK-8294699. Can they try to reproduce the issue using jdk23 build with JDK-8294699 fix?
13-12-2023