Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 36153 invoked from network); 15 Apr 2008 05:58:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Apr 2008 05:58:13 -0000 Received: (qmail 95364 invoked by uid 500); 15 Apr 2008 05:58:13 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 94983 invoked by uid 500); 15 Apr 2008 05:58:11 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 94938 invoked by uid 99); 15 Apr 2008 05:58:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Apr 2008 22:58:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Apr 2008 05:57:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EED43234C0D0 for ; Mon, 14 Apr 2008 22:55:04 -0700 (PDT) Message-ID: <538185807.1208238904977.JavaMail.jira@brutus> Date: Mon, 14 Apr 2008 22:55:04 -0700 (PDT) From: "Alexey Varlamov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-5261) [classlib][swing] JTextArea deadlocks on ArgoUML startup In-Reply-To: <29445751.1196861505412.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Varlamov updated HARMONY-5261: ------------------------------------- Component/s: Classlib Description: ArgoUML hangs on startup in client and JET modes of DRLVM. It displays ~25% on progress bar at splash screen and hangs. But it does not usually hang on interpreter, opt and server mode. Unfortunately J9 VME crashes much earlier, so no reference result is available. Remote debugging helped to prove this is a deadlock in classlib UI: 1) In AWT-EventDispatchThread: JTextArea.setText() forwards to AbstractDocument.replace(), which captures writeLock, then calls fireRemoveUpdate() which finally contends to lockAWT(); 2) In the Main thread: lockAWT() before adding a component to container, then calls through chain JComponent.getPreferredSize() -> JTextArea.getPreferredSize() -> AbstractDocument.readLock(). So the 1st thread holds document's lock and waits for AWT lock, while 2nd thread holds AWT lock and waits for document's lock. Below are complete traces: Thread [AWT-EventDispatchThread] (Suspended) VMThreadManager.wait(Object, long, int) line: not available [native method] Object.wait() line: 94 [local variables unavailable] Synchronizer.park(Thread) line: 197 Synchronizer.lock() line: 95 ToolkitImpl(Toolkit).lockAWT() line: 392 [local variables unavailable] JTextArea(Component).getSize() line: 1359 TextUtils.getEditorRect(JComponent) line: 1010 BasicTextAreaUI(BasicTextUI).getVisibleEditorRect() line: 537 BasicTextUI$Listener.removeUpdate(DocumentEvent) line: 263 PlainDocument(AbstractDocument).fireRemoveUpdate(DocumentEvent) line: 1276 PlainDocument(AbstractDocument).doRemove(int, int) line: 1413 PlainDocument(AbstractDocument).doReplace(int, int, String, AttributeSet) line: 1424 PlainDocument(AbstractDocument).replace(int, int, String, AttributeSet) line: 1213 JTextArea(JTextComponent).setText(String) line: 1556 WizDescription.setTarget(Object) line: 86 TabToDo.setTargetInternal(Object) line: 164 TabToDo.componentShown(ComponentEvent) line: 241 TabToDo(Component).processComponentEventImpl(ComponentEvent, Collection) line: 3814 TabToDo(Component).processComponentEvent(ComponentEvent) line: 3798 TabToDo(Component).processEvent(AWTEvent) line: 3652 TabToDo(Container).processEvent(AWTEvent) line: 1293 TabToDo(Component).dispatchEvent(AWTEvent) line: 3568 EventQueueCore.dispatchEventImpl(AWTEvent) line: 149 EventQueue.dispatchEvent(AWTEvent) line: 144 EventDispatchThread.runModalLoop(ModalContext) line: 74 EventDispatchThread.run() line: 48 Thread [main] (Suspended) VMThreadManager.wait(Object, long, int) line: not available [native method] Object.wait() line: 94 [local variables unavailable] AbstractDocument$ReadWriteLock.readLock() line: 857 PlainDocument(AbstractDocument).readLock() line: 1160 RootView.readLock() line: 295 RootView.getPreferredSpan(int) line: 166 BasicTextAreaUI(BasicTextUI).getPreferredSize(JComponent) line: 509 BasicTextAreaUI.getPreferredSize(JComponent) line: 108 JTextArea(JComponent).getPreferredSize() line: 468 JTextArea.getPreferredSize() line: 242 JTextArea.getPreferredScrollableViewportSize() line: 233 ViewportLayout.preferredLayoutSize(Container) line: 87 JViewport(JComponent).getPreferredSize() line: 474 ScrollPaneLayout.preferredLayoutSize(Container) line: 187 JScrollPane(JComponent).getPreferredSize() line: 474 BorderLayout.validateArrays(Container) line: 436 BorderLayout.validate(Container) line: 394 BorderLayout.minimumLayoutSize(Container) line: 274 JPanel(JComponent).getMinimumSize() line: 439 BorderLayout.validateArrays(Container) line: 435 BorderLayout.validate(Container) line: 394 BorderLayout.preferredLayoutSize(Container) line: 291 WizDescription(JComponent).getPreferredSize() line: 474 SplitterLayout.addLayoutComponent(String, Component) line: not available SplitterLayout(ProportionalLayout).addLayoutComponent(Component, Object) line: not available MultipleSplitPane(Container).addToLayout(Component, Object) line: 390 MultipleSplitPane(Container).addImpl(Component, Object, int) line: 424 MultipleSplitPane(Container).add(Component, Object, int) line: 236 MultipleSplitPane.add(Component, Object, int) line: not available BorderSplitPane.add(Component) line: not available BorderSplitPane.add(Component, Object) line: not available TabToDo.showDescription() line: 115 TabToDo.setTargetInternal(Object) line: 172 TabToDo.setTarget(Object) line: 158 DetailsPane.setTarget(Object) line: 297 DetailsPane.(String, Orientation) line: 185 ProjectBrowser.makeDetailsPane(String, Orientation) line: 938 ProjectBrowser.createDetailsPanes() line: 447 ProjectBrowser.createPanels(SplashScreen) line: 401 ProjectBrowser.(String, SplashScreen, boolean) line: 261 ProjectBrowser.makeInstance(SplashScreen, boolean) line: 354 ProjectBrowser.makeInstance(SplashScreen) line: 336 Main.initializeGUI(SplashScreen) line: 684 Main.main(String[]) line: 262 VMReflection.invokeMethod(long, Object, Object[]) line: not available [native method] Method.invoke(Object, Object[]) line: 317 JarRunner.main(String[]) line: 89 To reproduce: 1) Launch debuggee app: > java -agentlib:jdwp=server=y,transport=dt_socket,suspend=y -jar argouml.jar INFO: [TransportManager.cpp:204] transport is listening on 49077 2) In Eclipse UI, Debug -> Remote Java App-> (specify the port ) ->Debug, then switch to Debug perspective and enjoy As this is a race condition, it may take few attempts to capture the deadlock. was: ArgoUML hangs on startup in client and JET modes of DRLVM. It displays ~25% on progress bar at splash screen and hangs. But it does not hang on interpreter, opt and server mode. Unfortunately J9 VME crashes much earlier, so no reference result is available. Priority: Critical (was: Major) Affects Version/s: (was: 5.0M4) 5.0M6 Summary: [classlib][swing] JTextArea deadlocks on ArgoUML startup (was: [drlvm][jit][jet][awt] ArgoUML hangs) OK, I evaluated the picture with remote debugger and updated the issue accordingly. Hope this time UI people will address the issue. > [classlib][swing] JTextArea deadlocks on ArgoUML startup > -------------------------------------------------------- > > Key: HARMONY-5261 > URL: https://issues.apache.org/jira/browse/HARMONY-5261 > Project: Harmony > Issue Type: Bug > Components: App-Oriented Bug Reports, Classlib, DRLVM > Affects Versions: 5.0M6 > Reporter: Alexey Varlamov > Priority: Critical > Attachments: a.log, b.log, c.log > > > ArgoUML hangs on startup in client and JET modes of DRLVM. It displays ~25% on progress bar at splash screen and hangs. But it does not usually hang on interpreter, opt and server mode. > Unfortunately J9 VME crashes much earlier, so no reference result is available. > Remote debugging helped to prove this is a deadlock in classlib UI: > 1) In AWT-EventDispatchThread: JTextArea.setText() forwards to AbstractDocument.replace(), which captures writeLock, then calls fireRemoveUpdate() which finally contends to lockAWT(); > 2) In the Main thread: lockAWT() before adding a component to container, then calls through chain JComponent.getPreferredSize() -> JTextArea.getPreferredSize() -> AbstractDocument.readLock(). > So the 1st thread holds document's lock and waits for AWT lock, while 2nd thread holds AWT lock and waits for document's lock. > Below are complete traces: > Thread [AWT-EventDispatchThread] (Suspended) > VMThreadManager.wait(Object, long, int) line: not available [native method] > Object.wait() line: 94 [local variables unavailable] > Synchronizer.park(Thread) line: 197 > Synchronizer.lock() line: 95 > ToolkitImpl(Toolkit).lockAWT() line: 392 [local variables unavailable] > JTextArea(Component).getSize() line: 1359 > TextUtils.getEditorRect(JComponent) line: 1010 > BasicTextAreaUI(BasicTextUI).getVisibleEditorRect() line: 537 > BasicTextUI$Listener.removeUpdate(DocumentEvent) line: 263 > PlainDocument(AbstractDocument).fireRemoveUpdate(DocumentEvent) line: 1276 > PlainDocument(AbstractDocument).doRemove(int, int) line: 1413 > PlainDocument(AbstractDocument).doReplace(int, int, String, AttributeSet) line: 1424 > PlainDocument(AbstractDocument).replace(int, int, String, AttributeSet) line: 1213 > JTextArea(JTextComponent).setText(String) line: 1556 > WizDescription.setTarget(Object) line: 86 > TabToDo.setTargetInternal(Object) line: 164 > TabToDo.componentShown(ComponentEvent) line: 241 > TabToDo(Component).processComponentEventImpl(ComponentEvent, Collection) line: 3814 > TabToDo(Component).processComponentEvent(ComponentEvent) line: 3798 > TabToDo(Component).processEvent(AWTEvent) line: 3652 > TabToDo(Container).processEvent(AWTEvent) line: 1293 > TabToDo(Component).dispatchEvent(AWTEvent) line: 3568 > EventQueueCore.dispatchEventImpl(AWTEvent) line: 149 > EventQueue.dispatchEvent(AWTEvent) line: 144 > EventDispatchThread.runModalLoop(ModalContext) line: 74 > EventDispatchThread.run() line: 48 > Thread [main] (Suspended) > VMThreadManager.wait(Object, long, int) line: not available [native method] > Object.wait() line: 94 [local variables unavailable] > AbstractDocument$ReadWriteLock.readLock() line: 857 > PlainDocument(AbstractDocument).readLock() line: 1160 > RootView.readLock() line: 295 > RootView.getPreferredSpan(int) line: 166 > BasicTextAreaUI(BasicTextUI).getPreferredSize(JComponent) line: 509 > BasicTextAreaUI.getPreferredSize(JComponent) line: 108 > JTextArea(JComponent).getPreferredSize() line: 468 > JTextArea.getPreferredSize() line: 242 > JTextArea.getPreferredScrollableViewportSize() line: 233 > ViewportLayout.preferredLayoutSize(Container) line: 87 > JViewport(JComponent).getPreferredSize() line: 474 > ScrollPaneLayout.preferredLayoutSize(Container) line: 187 > JScrollPane(JComponent).getPreferredSize() line: 474 > BorderLayout.validateArrays(Container) line: 436 > BorderLayout.validate(Container) line: 394 > BorderLayout.minimumLayoutSize(Container) line: 274 > JPanel(JComponent).getMinimumSize() line: 439 > BorderLayout.validateArrays(Container) line: 435 > BorderLayout.validate(Container) line: 394 > BorderLayout.preferredLayoutSize(Container) line: 291 > WizDescription(JComponent).getPreferredSize() line: 474 > SplitterLayout.addLayoutComponent(String, Component) line: not available > SplitterLayout(ProportionalLayout).addLayoutComponent(Component, Object) line: not available > MultipleSplitPane(Container).addToLayout(Component, Object) line: 390 > MultipleSplitPane(Container).addImpl(Component, Object, int) line: 424 > MultipleSplitPane(Container).add(Component, Object, int) line: 236 > MultipleSplitPane.add(Component, Object, int) line: not available > BorderSplitPane.add(Component) line: not available > BorderSplitPane.add(Component, Object) line: not available > TabToDo.showDescription() line: 115 > TabToDo.setTargetInternal(Object) line: 172 > TabToDo.setTarget(Object) line: 158 > DetailsPane.setTarget(Object) line: 297 > DetailsPane.(String, Orientation) line: 185 > ProjectBrowser.makeDetailsPane(String, Orientation) line: 938 > ProjectBrowser.createDetailsPanes() line: 447 > ProjectBrowser.createPanels(SplashScreen) line: 401 > ProjectBrowser.(String, SplashScreen, boolean) line: 261 > ProjectBrowser.makeInstance(SplashScreen, boolean) line: 354 > ProjectBrowser.makeInstance(SplashScreen) line: 336 > Main.initializeGUI(SplashScreen) line: 684 > Main.main(String[]) line: 262 > VMReflection.invokeMethod(long, Object, Object[]) line: not available [native method] > Method.invoke(Object, Object[]) line: 317 > JarRunner.main(String[]) line: 89 > To reproduce: > 1) Launch debuggee app: > > java -agentlib:jdwp=server=y,transport=dt_socket,suspend=y -jar argouml.jar > INFO: [TransportManager.cpp:204] transport is listening on 49077 > 2) In Eclipse UI, Debug -> Remote Java App-> (specify the port ) ->Debug, then switch to Debug perspective and enjoy > As this is a race condition, it may take few attempts to capture the deadlock. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.