Java desktop application freezes with openjdk 8u252

Bug #1880246 reported by Albert Cardona
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
openjdk-8 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When launching the java desktop application Fiji (https://fiji.sc) using the system-wide openjdk 8u252, the UI is frozen. After trying many relaunches, occasionally (1 our of 30 times or so), the application isn't frozen, indicating some sort of race condition.

When the UI is frozen, the jconsole indicates that the event dispatch thread is blocked:

```
Name: AWT-EventQueue-1
State: BLOCKED on java.awt.Component$AWTTreeLock@1bde9d17 owned by: main
Total blocked: 10 Total waited: 61

Stack trace:
java.awt.Container.dispatchEventImpl(Container.java:2300)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
java.awt.EventQueue$4.run(EventQueue.java:733)
java.awt.EventQueue$4.run(EventQueue.java:731)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:705)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
```

When launching the Fiji java desktop application with openjdk java 8u172, no such problem occurs ever.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: openjdk-8-jdk 8u252-b09-1ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-31.35-generic 5.4.34
Uname: Linux 5.4.0-31-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Fri May 22 22:41:17 2020
EcryptfsInUse: Yes
InstallationDate: Installed on 2016-06-24 (1428 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: openjdk-8
UpgradeStatus: Upgraded to focal on 2020-05-20 (2 days ago)

Revision history for this message
Albert Cardona (albertcardona) wrote :
Revision history for this message
Albert Cardona (albertcardona) wrote :

Update: if run the Fiji launcher ```Image-linux64 --system``` (runs Fiji with java 8u252) and don't click anywhere until the Fiji window is open and ready, then the UI is responsive as expected (i.e. all is good).

But if I click away to another application while Fiji is launching, then the UI, when ready, is frozen.

A workaround is then to either be patient and not click anywhere, or to use the 8u172 java bundled with Fiji, which doesn't have this UI freezing problem. (Merely run Fiji like ```ImageJ-linux64```, assuming the Fiji.app/java/linux-amd64/ folder is populated with java jdk 8u172).

Revision history for this message
Albert Cardona (albertcardona) wrote :

A workaround has been found: launch the application and refrain from clicking away to any other application. When the Fiji java application is fully launched and ready, then it isn't frozen. Seems to work reliably so far.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-8 (Ubuntu):
status: New → Confirmed
Revision history for this message
Anaïs Huang (c0conut) wrote :

From now, I solved it when running Arduino IDE. The process is as following:
1. Uninstall the IDE
2. Delete `Arduino/` and `.arduino15/` in `~`.
3. Reinstall.
And it never freezes again.
I guess maybe it is due to the fact that I changed my java environment without updating the preferences of the app.
Taking Arduino IDE as an example, there is preferences.txt in `.arduino15/`. When simply installing a new IDE or uninstalling the original one, the file isn't changed automatically.
```bash
$ cat preferences.txt | grep java
preproc.imports.list=java.applet.*,java.awt.Dimension,java.awt.Frame,java.awt.event.MouseEvent,java.awt.event.KeyEvent,java.awt.event.FocusEvent,java.awt.Image,java.io.*,java.net.*,java.text.*,java.util.*,java.util.zip.*,java.util.regex.*
```

My current enviroment is
Ubuntu 20.04.3 LTS, 5.7.0-050700rc7-generic, java version "17.0.1" 2021-10-19 LTS.

So maybe the bug only affects openjdk 8u252.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.