ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Deadlock in IvyClasspathContainerImpl.setClasspathEntries() (regression from IVYDE-259)
Date Mon, 03 Mar 2014 09:45:43 GMT

The change in IvyClasspathContainer (asyncExec -> syncExec) may 
unfortunately lead 
to deadlock situations. If the main thread attempts to execute a job while 
the resolve job 
is already running, the main thread waits for the resolve job to finish. 
The latter then 
attempts to syncExec() into the main thread, which won't work.

Thread [Worker-4] (Suspended) 
        waiting for: RunnableLock  (id=122) 
        Object.wait(long) line: not available [native method] 
        RunnableLock(Object).wait() line: 503 
        Synchronizer.syncExec(Runnable) line: 187 
        Display.syncExec(Runnable) line: 4330 
line: 148 
 IvyClasspathContainerImpl.updateClasspathEntries(IClasspathEntry[]) line: 
        IvyClasspathResolver.postBatchResolve() line: 40 
        IvyResolveJob.doRun(IProgressMonitor) line: 263 line: 85 line: 54 

Thread [main] (Suspended) 
        owns: RunnableLock  (id=122) 
                waited by: Thread [Worker-4] (Suspended) 
        waiting for: Object  (id=123) 
        Object.wait(long) line: not available [native method] 
        Object.wait() line: 503 
        ThreadJob.waitForRun(ThreadJob, IProgressMonitor, InternalJob, 
Thread) line: 272 
        ThreadJob.joinRun(ThreadJob, IProgressMonitor) line: 199 
        ImplicitJobs.begin(ISchedulingRule, IProgressMonitor, boolean) 
line: 92 
        JobManager.beginRule(ISchedulingRule, IProgressMonitor) line: 286 
        WorkManager.checkIn(ISchedulingRule, IProgressMonitor) line: 118 
        Workspace.prepareOperation(ISchedulingRule, IProgressMonitor) 
line: 2282 
        Folder(Resource).refreshLocal(int, IProgressMonitor) line: 1655 
        ExternalFoldersManager.createLinkFolder(IPath, boolean, IProject, 
IProgressMonitor) line: 155 
        ExternalFoldersManager.createLinkFolder(IPath, boolean, 
IProgressMonitor) line: 145 
IProgressMonitor) line: 48 
boolean) line: 62 
        SetContainerOperation.executeOperation() line: 110 
line: 728, ISchedulingRule, int, 
IProgressMonitor) line: 2344 
line: 793 
        JavaCore.setClasspathContainer(IPath, IJavaProject[], 
IClasspathContainer[], IProgressMonitor) line: 4952 
        IvyClasspathContainerImpl.notifyUpdateClasspathEntries() line: 172 

        IvyClasspathContainerImpl$ line: 162 line: 35 
        Synchronizer.runAsyncMessages(boolean) line: 135 
        Display.runAsyncMessages(boolean) line: 3563 
        Display.readAndDispatch() line: 3212 

I'm wondering why the IvyClasspathContainer (now Impl) needs to syncExec() 
or asyncExec() at all. 
Do you remember why it cannot update the classpath in the background 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message