[Ikvm-developers] possible ikvmc AWT deadlock
Brought to you by:
jfrijters
|
From: Matthias D. <mat...@go...> - 2012-03-08 11:04:07
|
Hello,
hope this is the right section to post this issue, so I will just jump into
it.
I did download the latest jDownloader source, exported it and recompiled it
to a .net library with ikvmc.
This works fine and jDownloader is running, however on certain
circumstances the gui will freeze completly (for example opening the
settings).
I did some further analysis and came up with a stacktrace on the
"deadlocked" awt thread:
[Deaktiviert, wartend oder verknüpft]
mscorlib.dll!System.Threading.Monitor.Wait(object obj, int
millisecondsTimeout, bool exitContext) + 0x18 Bytes
mscorlib.dll!System.Threading.Monitor.Wait(object obj) + 0xa Bytes
IKVM.OpenJDK.Core.dll!java.lang.Thread.objectWait() + 0x118 Bytes
IKVM.OpenJDK.Core.dll!java.lang.Object.instancehelper_wait(object this
= {sun.awt.image.ImageRepresentation}) + 0x28 Bytes
IKVM.OpenJDK.SwingAWT.dll!sun.awt.image.ImageRepresentation.reconstruct(int
flags = 32) + 0xdc Bytes
IKVM.AWT.WinForms.dll!ikvm.awt.J2C.ConvertImage(java.awt.Image img =
{sun.awt.image.ToolkitImage}) + 0x146 Bytes
IKVM.AWT.WinForms.dll!ikvm.awt.NetGraphics.drawImage(java.awt.Image
img = {sun.awt.image.ToolkitImage}, int x = 0, int y = 0, int width = 32,
int height = 32, java.awt.image.ImageObserver observer = null) + 0x54
Bytes
IKVM.AWT.WinForms.dll!ikvm.awt.NetGraphics.drawImage(java.awt.Image
img = {sun.awt.image.ToolkitImage}, int x = 0, int y = 0,
java.awt.image.ImageObserver observer = null) + 0x9c Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.ImageIcon.paintIcon(java.awt.Component
c = null, java.awt.Graphics g = {ikvm.awt.BitmapGraphics}, int x = 0, int y
= 0) + 0x4b Bytes
jDownloader.dll!org.appwork.resources.Theme.getDisabledIcon(javax.swing.ImageIcon
_getIcon = {javax.swing.ImageIcon}) + 0x12e Bytes
jDownloader.dll!jd.gui.swing.jdgui.views.settings.sidebar.ExtensionPanelListRenderer.setIcon()
+ 0x52 Bytes
jDownloader.dll!jd.gui.swing.jdgui.views.settings.sidebar.ExtensionPanelListRenderer.getListCellRendererComponent(javax.swing.JList
list = {jd.gui.swing.jdgui.views.settings.sidebar.ConfigSidebar$1}, object
value =
{jd.gui.swing.jdgui.views.settings.panels.linkgrabberfilter.Linkgrabber},
int index = 8, bool isSelected = false, bool cellHasFocus = false) + 0x7c
Bytes
jDownloader.dll!jd.gui.swing.jdgui.views.settings.sidebar.TreeRenderer.getListCellRendererComponent(javax.swing.JList
list = {jd.gui.swing.jdgui.views.settings.sidebar.ConfigSidebar$1}, object
value =
{jd.gui.swing.jdgui.views.settings.panels.linkgrabberfilter.Linkgrabber},
int index = 8, bool isSelected = false, bool cellHasFocus = false) + 0x95
Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.plaf.basic.BasicListUI.updateLayoutState()
+ 0x1c4 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState()
+ 0x29 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.plaf.basic.BasicListUI.Handler.valueChanged()
+ 0x3b Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultListSelectionModel.fireValueChanged(int
firstIndex = 0, int lastIndex = 0, bool isAdjusting = false) + 0xda
Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultListSelectionModel.fireValueChanged(int
firstIndex = 0, int lastIndex = 0) + 0x4e Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultListSelectionModel.fireValueChanged()
+ 0xc0 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultListSelectionModel.changeSelection()
+ 0xf3 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultListSelectionModel.changeSelection()
+ 0x31 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultListSelectionModel.setSelectionInterval(int
index0 = 0, int index1 = 0) + 0xb8 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.JList.setSelectedIndex(int index
= 0) + 0x6a Bytes
jDownloader.dll!jd.gui.swing.jdgui.views.settings.sidebar.ConfigSidebar.setSelectedTreeEntry(java.lang.Class
class1 = {java.lang.Class}) + 0x113 Bytes
jDownloader.dll!jd.gui.swing.jdgui.views.settings.ConfigurationPanel.onShow()
+ 0x145 Bytes
jDownloader.dll!jd.gui.swing.jdgui.interfaces.SwitchPanel.setShown() +
0x40 Bytes
jDownloader.dll!jd.gui.swing.jdgui.views.settings.ConfigurationView.onShow()
+ 0x6f Bytes
jDownloader.dll!jd.gui.swing.jdgui.interfaces.SwitchPanel.setShown() +
0x40 Bytes
jDownloader.dll!jd.gui.swing.jdgui.MainTabbedPane$1.stateChanged() +
0x15b Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.JTabbedPane.fireStateChanged() +
0x22e Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.JTabbedPane.ModelListener.stateChanged(javax.swing.event.ChangeEvent
e = {javax.swing.event.ChangeEvent}) + 0x2b Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultSingleSelectionModel.fireStateChanged()
+ 0xc5 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultSingleSelectionModel.setSelectedIndex(int
index = 2) + 0x39 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.JTabbedPane.setSelectedIndexImpl() +
0x152 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.JTabbedPane.setSelectedIndex(int
index = 2) + 0x39 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.JTabbedPane.setSelectedComponent(java.awt.Component
c = {jd.gui.swing.jdgui.views.settings.ConfigurationView}) + 0x50 Bytes
jDownloader.dll!jd.gui.swing.jdgui.MainTabbedPane.setSelectedComponent(java.awt.Component
e = {jd.gui.swing.jdgui.views.settings.ConfigurationView}) + 0x6d Bytes
jDownloader.dll!jd.gui.swing.jdgui.JDGui.setContent(jd.gui.swing.jdgui.interfaces.View
view = {jd.gui.swing.jdgui.views.settings.ConfigurationView}, bool
setActive = true) + 0x71 Bytes
jDownloader.dll!jd.gui.swing.jdgui.menu.actions.SettingsAction.onAction(java.awt.event.ActionEvent
e = {java.awt.event.ActionEvent}) + 0x62 Bytes
jDownloader.dll!jd.gui.swing.jdgui.menu.actions.ActionAdapter.actionPerformed(java.awt.event.ActionEvent
e = {java.awt.event.ActionEvent}) + 0x28 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.AbstractButton.fireActionPerformed(java.awt.event.ActionEvent
event = {java.awt.event.ActionEvent}) + 0x14b Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.AbstractButton.Handler.actionPerformed()
+ 0x2e Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultButtonModel.fireActionPerformed(java.awt.event.ActionEvent
e = {java.awt.event.ActionEvent}) + 0x92 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.DefaultButtonModel.setPressed(bool b
= false) + 0x1bb Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.AbstractButton.doClick(int
pressTime = 0) + 0xe8 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.plaf.basic.BasicMenuItemUI.doClick(javax.swing.MenuSelectionManager
msm = {javax.swing.MenuSelectionManager}) + 0xc5 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.plaf.basic.BasicMenuItemUI.Handler.mouseReleased()
+ 0xd2 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.AWTEventMulticaster.mouseReleased(java.awt.event.MouseEvent
e = {java.awt.event.MouseEvent}) + 0x35 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Component.processMouseEvent(java.awt.event.MouseEvent
e = {java.awt.event.MouseEvent}) + 0x79 Bytes
IKVM.OpenJDK.SwingAWT.dll!javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent
e = {java.awt.event.MouseEvent}) + 0x52 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Component.processEvent(java.awt.AWTEvent
e = {java.awt.event.MouseEvent}) + 0xd7 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Container.processEvent(java.awt.AWTEvent
e = {java.awt.event.MouseEvent}) + 0x74 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Component.dispatchEventImpl() +
0x9cf Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Container.dispatchEventImpl() +
0x98 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Component.dispatchEvent(java.awt.AWTEvent
e = {java.awt.event.MouseEvent}) + 0x28 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.LightweightDispatcher.retargetMouseEvent()
+ 0x5ab Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.LightweightDispatcher.processMouseEvent()
+ 0x154 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.LightweightDispatcher.dispatchEvent() +
0xf1 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Container.dispatchEventImpl() +
0x57 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Window.dispatchEventImpl() + 0x4e
Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.Component.dispatchEvent(java.awt.AWTEvent
e = {java.awt.event.MouseEvent}) + 0x28 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventQueue.dispatchEventImpl() +
0x9f Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventQueue.access$000() + 0x2b
Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventQueue$3.run() + 0x3b Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventQueue$3.run() + 0x22 Bytes
IKVM.OpenJDK.Core.dll!java.security.AccessController.doPrivileged() +
0xe4 Bytes
IKVM.OpenJDK.Core.dll!java.security.AccessController.doPrivileged(java.security.PrivilegedAction
action = {java.awt.EventQueue$3}, java.security.AccessControlContext
context = {java.security.AccessControlContext}) + 0x28 Bytes
IKVM.OpenJDK.Core.dll!java.security.ProtectionDomain$1.doIntersectionPrivilege()
+ 0x98 Bytes
IKVM.OpenJDK.Core.dll!java.security.ProtectionDomain$1.doIntersectionPrivilege()
+ 0x3f Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventQueue$4.run() + 0x3b Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventQueue$4.run() + 0x22 Bytes
IKVM.OpenJDK.Core.dll!java.security.AccessController.doPrivileged() +
0xe4 Bytes
IKVM.OpenJDK.Core.dll!java.security.AccessController.doPrivileged(java.security.PrivilegedAction
action = {java.awt.EventQueue$4}, java.security.AccessControlContext
context = {java.security.AccessControlContext}) + 0x28 Bytes
IKVM.OpenJDK.Core.dll!java.security.ProtectionDomain$1.doIntersectionPrivilege()
+ 0x98 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventQueue.dispatchEvent(java.awt.AWTEvent
event = {java.awt.event.MouseEvent}) + 0xf8 Bytes
jDownloader.dll!org.appwork.app.gui.copycutpaste.CopyCutPasteHandler.dispatchEvent(java.awt.AWTEvent
event = {java.awt.event.MouseEvent}) + 0x4b Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventDispatchThread.pumpOneEventForFilters()
+ 0x51f Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventDispatchThread.pumpEventsForFilter()
+ 0x6c Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventDispatchThread.pumpEventsForHierarchy()
+ 0x47 Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventDispatchThread.pumpEvents() +
0x2d Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventDispatchThread.pumpEvents() +
0x2b Bytes
IKVM.OpenJDK.SwingAWT.dll!java.awt.EventDispatchThread.run() + 0x68
Bytes
IKVM.OpenJDK.Core.dll!java.lang.Thread.threadProc2() + 0x4b Bytes
IKVM.OpenJDK.Core.dll!java.lang.Thread.threadProc() + 0x4f Bytes
IKVM.OpenJDK.Core.dll!java.lang.Thread$1.Invoke() + 0x23 Bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object
state) + 0x63 Bytes
mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object
userData) + 0x51 Bytes
[Übergang von Systemeigen zu Verwaltet]
[Übergang von Verwaltet zu Systemeigen]
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext
executionContext, System.Threading.ContextCallback callback, object state)
+ 0x6a Bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
executionContext, System.Threading.ContextCallback callback, object state,
bool ignoreSyncCtx) + 0x7e Bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
executionContext, System.Threading.ContextCallback callback, object state)
+ 0x2c Bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44
Bytes
[Übergang von Systemeigen zu Verwaltet]
Running it via "ikvm -jar jDownloader.jar" however does work and you get to
see the settings panel but I did recognize the following exception:
cli.System.MissingMethodException: Methode nicht gefunden: "Void
javax.swing.JSpinner..ctor(javax.swing..ctor)".
at org.appwork.swing.components.ExtSpinner.<init>(ExtSpinner.java)
at
jd.gui.swing.jdgui.views.settings.components.Spinner.<init>(Spinner.java:30)
at
jd.gui.swing.jdgui.views.settings.panels.DownloadControll.<init>(DownloadControll.java:55)
at
jd.gui.swing.jdgui.views.settings.sidebar.SettingsSidebarModel$1.runInEDT(SettingsSidebarModel.java:76)
at org.appwork.utils.swing.EDTRunner.edtRun(EDTRunner.java:19)
at org.appwork.utils.swing.EDTHelper.run(EDTHelper.java:72)
at org.appwork.utils.swing.EDTHelper.start(EDTHelper.java:97)
at org.appwork.utils.swing.EDTHelper.start(EDTHelper.java:85)
at org.appwork.utils.swing.EDTRunner.<init>(EDTRunner.java:13)
at
jd.gui.swing.jdgui.views.settings.sidebar.SettingsSidebarModel$1.<init>(SettingsSidebarModel.java:55)
at
jd.gui.swing.jdgui.views.settings.sidebar.SettingsSidebarModel.fill(SettingsSidebarModel.java:55)
at
jd.gui.swing.jdgui.views.settings.sidebar.ConfigSidebar.updateAddons(ConfigSidebar.java:251)
at
jd.gui.swing.jdgui.views.settings.ConfigurationPanel.onShow(ConfigurationPanel.java:57)
at
jd.gui.swing.jdgui.interfaces.SwitchPanel.setShown(SwitchPanel.java:88)
at
jd.gui.swing.jdgui.views.settings.ConfigurationView.onShow(ConfigurationView.java:73)
at
jd.gui.swing.jdgui.interfaces.SwitchPanel.setShown(SwitchPanel.java:88)
at
jd.gui.swing.jdgui.MainTabbedPane$1.stateChanged(MainTabbedPane.java:109)
at javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:411)
at
javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:270)
at
javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingleSelectionModel.java:127)
at
javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingleSelectionModel.java:67)
at
javax.swing.JTabbedPane.setSelectedIndexImpl(JTabbedPane.java:618)
at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:591)
at
javax.swing.JTabbedPane.setSelectedComponent(JTabbedPane.java:677)
at
jd.gui.swing.jdgui.MainTabbedPane.setSelectedComponent(MainTabbedPane.java:142)
at jd.gui.swing.jdgui.JDGui.setContent(JDGui.java:437)
at
jd.gui.swing.jdgui.menu.actions.SettingsAction.onAction(SettingsAction.java:39)
at
jd.gui.swing.jdgui.menu.actions.ActionAdapter.actionPerformed(ActionAdapter.java:31)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2004)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:377)
at
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4860)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4686)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4835)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4493)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4686)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:667)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at
java.security.AccessController.doPrivileged(AccessController.java:277)
at
java.security.AccessController.doPrivileged(AccessController.java:388)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:681)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at
java.security.AccessController.doPrivileged(AccessController.java:277)
at
java.security.AccessController.doPrivileged(AccessController.java:388)
at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at
org.appwork.app.gui.copycutpaste.CopyCutPasteHandler.dispatchEvent(CopyCutPasteHandler.java:31)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:212)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
So maybe they go in hand (but I don't think so)
To reproduce the issue:
1. http://jdownloader.org/knowledge/wiki/development/get-started
2. export the JDownloader Project as runnable jar with the extract option
(using eclipse in my case)
3. Get the latest developer snapshot from ikvm (or you will run into a
stackoverflow I did report)
4. Run "ikvmc.exe" -classloader:ikvm.runtime.ClassPathAssemblyClassLoader
jDownloader.jar
5. Run the generated jDownloader.exe file, wait for jDownloader to start
successfully and click menu=>settings=>settings
I don't need this to be fixed as I'm don't using the jDownloader Gui
anyway, It would be nice for debugging though.
Also I did some "hacky" workaround because of this issue to make the swing
thread resposible again:
swingThread.interrupt();
var newEventQueue = new EventQueue();
var put =
(EventQueue)AppContext.getAppContext().put(AppContext.EVENT_QUEUE_KEY,
newEventQueue);
var toolkit = java.awt.Toolkit.getDefaultToolkit();
var eventQueue = toolkit.getSystemEventQueue();
Debug.Assert(newEventQueue == eventQueue);
I don't know if this is good or bad but in my situation this works and is
all I need.
And as little bonus after some time the gui is responsible again?!
Hope this helps somebody to fix the issue, if there is anything other I can
do to help (stacktraces, minidumps or something like that), just let me know
Regards,
Matthias
|