Thilo Goetz wrote:
Aaron Kaplan wrote:
It seems like there's a race condition in the CVD interface somewhere.
Often when I try to run it it just hangs, before the window ever
appears. If I kill it and run it again, it works fine... or sometimes
not.
The main thread's stack looks like this when it's stuck:
Thread [main] (Suspended) JMenuItem(Component).enable() line:
1246 JMenuItem(JComponent).enable() line: 3563
JMenuItem(Component).enable(boolean) line: 1270
JMenuItem(Component).setEnabled(boolean) line: 1235
JMenuItem(JComponent).setEnabled(boolean) line: 2647
JMenuItem(AbstractButton).setEnabled(boolean) line: 2064
JMenuItem.setEnabled(boolean) line: 294
MainFrame.setUndoEnabled(boolean) line: 2057
UndoMgr.addEdit(UndoableEdit) line: 52
UndoMgr(UndoManager).undoableEditHappened(UndoableEditEvent) line:
596
PlainDocument(AbstractDocument).fireUndoableEditUpdate(UndoableEditEvent)
line: 270 PlainDocument(AbstractDocument).handleRemove(int,
int) line: 612 PlainDocument(AbstractDocument).remove(int, int)
line: 576 PlainDocument(AbstractDocument).replace(int, int,
String, AttributeSet) line: 652
JTextArea(JTextComponent).setText(String) line: 1693
MainFrame.setTextNoTitle(String) line: 721 MainFrame.loadFile()
line: 597 MainFrame.loadTextFile(File) line: 716
CVD.main(String[]) line: 126 Gladis.main(String[]) line: 36
Any solutions or debugging hints would be appreciated.
-Aaron
Hm, where does the "Gladis" in your stack trace come from? I don't
remember when we removed that class, but it's a while ago.
I can reproduce this issue with the -text option on the command
line. I'll take a look. If you have any ideas how to fix this,
let me know.
I think the way CVD is started with command line parameters is just
wrong. The main UI is started while commands execute that already
try to set properties of the UI. What we're seeing is a deadlock
between the UI setting up, and text being loaded (with UI side effects).
If the file has been loaded before, it's fast enough to go through.
I've been able to reliably reproduce the hang with a large enough
file.
In the short term, I can only offer the following workaround: start
CVD without command line parameters, then load the file manually.
--Thilo