Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321751 - Deadlock detector can be broken with cancellation and IJobManager#transferRule
Summary: Deadlock detector can be broken with cancellation and IJobManager#transferRule
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.6   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 11:52 EDT by James Blackburn CLA
Modified: 2019-11-14 02:21 EST (History)
3 users (show)

See Also:


Attachments
test 1 (3.01 KB, patch)
2010-08-04 11:52 EDT, James Blackburn CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Blackburn CLA 2010-08-04 11:52:32 EDT
Created attachment 175845 [details]
test 1

While attempting a fix for bug 262032 I discovered that transferring rules appears to break the DeadlockDetector if a thread blocked in beginRule is cancelled as the rule is transferred to it.

Simple IJobManager Test attached, I get this exception, and subsequent tests fail as the deadlock detector is disabled:

org.eclipse.core.runtime.AssertionFailedException: assertion failed: Thread main was not waiting for lock PathRule(testTransferToJobWithCancel) so it could not time out.

at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
at org.eclipse.core.internal.jobs.DeadlockDetector.lockWaitStop(DeadlockDetector.java:434)
at org.eclipse.core.internal.jobs.LockManager.removeLockWaitThread(LockManager.java:285)
at org.eclipse.core.internal.jobs.ThreadJob.waitEnd(ThreadJob.java:413)
at org.eclipse.core.internal.jobs.ThreadJob.waitForRun(ThreadJob.java:286)
at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:199)
at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:92)
at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285)
at org.eclipse.core.tests.runtime.jobs.IJobManagerTest.testTransferToJobWithCancel(IJobManagerTest.java:1765)


!ENTRY org.eclipse.core.jobs 4 2 2010-08-04 16:49:32.116
!MESSAGE LockManager.handleException
!STACK 0
java.lang.Exception:  :: 
 PathRule(testTransferToJobWithCancel),
 main :  1,
-------

at org.eclipse.core.internal.jobs.LockManager.handleInternalError(LockManager.java:204)
at org.eclipse.core.internal.jobs.LockManager.removeLockWaitThread(LockManager.java:288)
at org.eclipse.core.internal.jobs.ThreadJob.waitEnd(ThreadJob.java:413)
at org.eclipse.core.internal.jobs.ThreadJob.waitForRun(ThreadJob.java:286)
at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:199)
at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:92)
at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:285)
at org.eclipse.core.tests.runtime.jobs.IJobManagerTest.testTransferToJobWithCancel(IJobManagerTest.java:1765)
Comment 1 James Blackburn CLA 2010-08-04 11:58:16 EDT
Adding Min to the CC as he was involved in the rule yielding / transfer stuff as part of bug 283449
Comment 2 Lars Vogel CLA 2019-11-14 02:21:42 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.