rilian-la-te/java-swing-ayatana

Android Studio hangs when opening dialogs

Closed this issue · 13 comments

What steps will reproduce the problem?
1.Install ayatana
2.Start Android Studio
3.Go into Settings or any other thing that spawns a dialog

What is the expected output? What do you see instead?
Hangs the entire java app just before the new window is set to be initialized 
by Android Studio. This doesn't happen *every time* a new dialog is presented, 
but very often.

What version of the product are you using? On what operating system?
Happens with ayatana 2.3 and 2.6 on Ubuntu 13.10.


Please provide any additional information below.
Presumably happens with IntelliJ IDEA too, but I haven't verified this. This is 
basically a show-stopper, as an unreliable IDE that freezes up "randomly" is no 
use at all :(

Original issue reported on code.google.com by justi...@gmail.com on 3 Apr 2014 at 2:39

[deleted comment]
Have some more information that may be potentially useful. I attached jconsole 
to IntelliJ (Android Studio) and reproduced the issue. Now it showed this 
thread blocked, which may have to do with the issue.

Name: AWT-EventQueue-0 0.5.3#AI-135.1092050, eap:true
State: BLOCKED on com.jarego.jayatana.swing.SwingGlobalMenuWindow@ee524bd owned 
by: Thread-486
Total blocked: 310  Total waited: 4,886

Stack trace: 
com.jarego.jayatana.basic.GlobalMenuAdapter.lockMenuBar(Unknown Source)
com.jarego.jayatana.swing.SwingGlobalMenu$1.run(Unknown Source)
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
java.awt.EventQueue.access$200(EventQueue.java:103)
java.awt.EventQueue$3.run(EventQueue.java:694)
java.awt.EventQueue$3.run(EventQueue.java:692)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:7
6)
java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242
)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
java.security.AccessController.doPrivileged(Native Method)
java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
java.awt.Dialog.show(Dialog.java:1082)
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPe
erImpl.java:787)
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.ja
va:463)
com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1555)
com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1522)
com.intellij.ide.actions.ShowSettingsUtilImpl._showSettingsDialog(ShowSettingsUt
ilImpl.java:72)
com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUti
lImpl.java:54)
com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.j
ava:63)
com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUti
l.java:164)
com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(Ac
tionMenuItem.java:261)
com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.j
ava:923)
com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManager
Impl.java:124)
com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPe
rformed(ActionMenuItem.java:231)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(Action
MenuItem.java:104)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)
com.jarego.jayatana.swing.SwingGlobalMenuWindow$2.run(Unknown Source)
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
java.awt.EventQueue.access$200(EventQueue.java:103)
java.awt.EventQueue$3.run(EventQueue.java:694)
java.awt.EventQueue$3.run(EventQueue.java:692)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:7
6)
java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:697)
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242
)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150
)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Original comment by justi...@gmail.com on 3 Apr 2014 at 3:54

It seems in 2.3 it is relatively unlikely to happen. I can't seem to reproduce 
it anymore, but it did hang once or twice with 2.3. Might be another bug for 
2.3.

Anyway, with 2.6 it's almost 100% reproducable.

Original comment by justi...@gmail.com on 3 Apr 2014 at 4:07

Thank you, I know what is the problem, It's a synchronized method, lockMenuBar, 
It's to support the lock from menu bar, when the new dialog in modal mode is 
opened

Original comment by danjaredg on 6 Apr 2014 at 1:49

  • Changed state: Accepted
Cool, let me know if I can help test or debug anything. Happy to assist, great 
project!

Original comment by justi...@gmail.com on 7 Apr 2014 at 12:33

Can you help me to check the fix?, the fix released on jayatana-test ppa

Original comment by danjaredg on 9 Apr 2014 at 3:23

  • Changed state: Started
I will do so now. Sorry for the delay, I will report back soon

Original comment by justi...@gmail.com on 10 Apr 2014 at 8:03

It seems this issue is now indeed gone.

During 5 minutes of testing I did get a freeze of a different kind now. No 
thread seems blocked when I looked with a debugger, but the entire app is still 
frozen. When the app has 'focus' in this frozen mode, the cursor seems to 
indicate the active element is the editor (like this 
http://upload.wikimedia.org/wikipedia/commons/6/61/Cursor-design1-text.png ). 
Not sure if this means anything.

This freeze may be the same as the one I got a few times in 2.3 (the one I 
mentioned in comment #3)

I'll try to reproduce it a few more times.

Original comment by justi...@gmail.com on 10 Apr 2014 at 8:19

dialogs in arduino ide also hangs

Original comment by vsevolod.balashov on 4 May 2014 at 8:39

P.S. arduino ide with jayatana (2.6.1-1) from test repo just crashed

Original comment by vsevolod.balashov on 5 May 2014 at 12:36

Can you help me to check the fix again?, the fix released on jayatana-test ppa, 
2.7 version is ready

Original comment by danjaredg on 11 Dec 2014 at 12:00

but only for trusty and utopic versions

Original comment by danjaredg on 11 Dec 2014 at 12:04

There aren't more comments about this error.

Original comment by danjaredg on 25 Feb 2015 at 3:14

  • Changed state: Invalid