And regarding "Unresponsive Program", I posted the following on the dev forum on June 26, 2010, titled "Swing Deadlocks". Nobody there responded and the issue remains undebugged and unresolved; it happened to me yesterday. Perhaps somebody here knows more how debug Swing issues.
---
Does anybody have any expertise in debugging these? A couple times a week, I get KoLmafia to hang when I am consuming stuff from the Item Manager and then click around and back to the Item Manager. A spinning beach ball appears whenever my mouse is over any KoLmafia frame and I have to ^C KoLmafia from the Terminal to get out of it.
Today, I started running under Eclipse, because I am tired of having my Store Manager get screwed up when it gets a stack trace, somewhere, which happens multiple times a day for me. I was unable to get that stack trace to happen, although I will continue looking, but I did get the Swing deadlock.
Here are three tasks that seem to be deadlocked.
This is the Swing Event Queue. Notice that a Button was pressed on the UseItemEnqueuePanel, which calls ConcoctionDatabase.consumeItem, which at line 790 invokes RequestThread.postRequest on the Use Item Request. Since this is the event queue, that posts the task to Foxtrot. That send the request over to the workerThread and waits for events.
PostEventQueue.this is id = 69
Code:
Thread [AWT-EventQueue-0] (Suspended)
PostEventQueue.flush() line: 2099 [local variables unavailable]
SunToolkit.flushPendingEvents() line: 611 [local variables unavailable]
ConditionalEventPump.peekEvent(EventQueue) line: 234
ConditionalEventPump.waitForEvent() line: 212
ConditionalEventPump.pumpEvent(Task) line: 139
ConditionalEventPump.access$300(ConditionalEventPump, Task) line: 32
ConditionalEventPump$Conditional.invoke(Object, Method, Object[]) line: 259
$Proxy1.evaluate() line: not available
EventDispatchThread.pumpEventsForFilter(int, Conditional, EventFilter) line: 210
EventDispatchThread.pumpEventsForHierarchy(int, Conditional, Component) line: 201
EventDispatchThread.pumpEvents(int, Conditional) line: 196
EventDispatchThread.pumpEvents(Conditional) line: 188
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 597
ConditionalEventPump.pumpEvents(Task) line: 99
Worker(AbstractSyncWorker).post(Task, WorkerThread, EventPump) line: 94
Worker(AbstractSyncWorker).post(Job, WorkerThread, EventPump) line: 120
Worker.post(Job) line: 143
RequestThread.postRequest(GenericRequest) line: 77
ConcoctionDatabase.consumeItem(Concoction, int) line: 790
ConcoctionDatabase.handleQueue(boolean, boolean, boolean, int) line: 769
UseItemEnqueuePanel$ExecuteListener.run() line: 224
UseItemEnqueuePanel$ExecuteListener(ThreadedListener).actionPerformed(ActionEvent) line: 59
JButton(AbstractButton).fireActionPerformed(ActionEvent) line: 2028
AbstractButton$Handler.actionPerformed(ActionEvent) line: 2351
DefaultButtonModel.fireActionPerformed(ActionEvent) line: 387
DefaultButtonModel.setPressed(boolean) line: 242
AquaButtonUI$AquaButtonListener(BasicButtonListener).mouseReleased(MouseEvent) line: 236
JButton(Component).processMouseEvent(MouseEvent) line: 6348
JButton(JComponent).processMouseEvent(MouseEvent) line: 3267
JButton(Component).processEvent(AWTEvent) line: 6113
JButton(Container).processEvent(AWTEvent) line: 2085
JButton(Component).dispatchEventImpl(AWTEvent) line: 4714
JButton(Container).dispatchEventImpl(AWTEvent) line: 2143
JButton(Component).dispatchEvent(AWTEvent) line: 4544
LightweightDispatcher.retargetMouseEvent(Component, int, MouseEvent) line: 4618
LightweightDispatcher.processMouseEvent(MouseEvent) line: 4282
LightweightDispatcher.dispatchEvent(AWTEvent) line: 4212
ItemManageFrame(Container).dispatchEventImpl(AWTEvent) line: 2129
ItemManageFrame(Window).dispatchEventImpl(AWTEvent) line: 2478
ItemManageFrame(Component).dispatchEvent(AWTEvent) line: 4544
EventQueue.dispatchEvent(AWTEvent) line: 635
EventDispatchThread.pumpOneEventForFilters(int) line: 296
EventDispatchThread.pumpEventsForFilter(int, Conditional, EventFilter) line: 211
EventDispatchThread.pumpEventsForHierarchy(int, Conditional, Component) line: 201
EventDispatchThread.pumpEvents(int, Conditional) line: 196
EventDispatchThread.pumpEvents(Conditional) line: 188
EventDispatchThread.run() line: 122
Here is the Worker thread.
It is in UseItemRequest and is updating the status line via KoLmafia.updateDisplay. It happens to be hung trying to update the MallSearchFrame.
Both this task and the other are inside SunToolkit.flushPendingEvents() at line 611. Neither is proceeding.
PostEventQueue.this is id = 69
EventQueue.this is id = 68 and we are synchronized on "this"
Code:
Daemon Thread [Foxtrot Single Worker Thread #3] (Suspended)
EventQueue.postEventPrivate(AWTEvent) line: 212
EventQueue.postEvent(AWTEvent) line: 198
PostEventQueue.flush() line: 2107
SunToolkit.flushPendingEvents() line: 611
EventQueue.postEvent(AWTEvent) line: 197
EventQueue.invokeLater(Runnable) line: 991
SwingUtilities.invokeLater(Runnable) line: 1261
JButton(JComponent).revalidate() line: 4798
JButton(AbstractButton).setText(String) line: 296
ActionPanel$VerifyButtonPanel.setEnabled(boolean) line: 139
MallSearchFrame$MallSearchPanel(ActionVerifyPanel).setEnabled(boolean) line: 345
MallSearchFrame$MallSearchPanel(GenericPanel).setEnabled(boolean) line: 261
KoLmafia.updateDisplayState(int, String) line: 653
KoLmafia.updateDisplay(int, String) line: 634
KoLmafia.updateDisplay(String) line: 609
UseItemRequest.useOnce(int, int, String) line: 1261
UseItemRequest.run() line: 877
AbstractWorkerThread$AbstractWorkerAction.run() line: 84
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
SingleWorkerThread(AbstractWorkerThread).runTask(Task) line: 41
SingleWorkerThread.run(Task) line: 235
SingleWorkerThread.run() line: 216
Thread.run() line: 637
Here is another thread which seems to be posting to the event queue. Looking at the arguments, it is a Mouse event. The "source" is "ItemManageFrame". Presumably, this is the task that detected and dispatched my mouse click.
PostEventQueue.this is id = 69
Code:
Daemon Thread [AWT-AppKit] (Suspended)
PostEventQueue.postEvent(AWTEvent) line: 2121
SunToolkit.postEvent(AppContext, AWTEvent) line: 585
CToolkit.postEvent(AWTEvent) line: 1086
EventFactoryProxy.forwardEvent(AWTEvent) line: 53
I don't know how to find who has the lock on the object. I have no idea how to proceed. I'm going to kill this and continue my day. If anybody has any advice on what to do to debug this better next time, I'm all ears.