google-code-export / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Icarus threading error - non-synchronized access to Dictionary in TaskRunner #843

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enabled auto-reload for a 22-project solution, so Icarus tries to run 
multiple tests at once.
2. Looks like access to the dictionary isn't properly synchronized.
3.

What is the expected output? What do you see instead?

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Collections.Generic.Dictionary`2.Resize()
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Gallio.UI.ProgressMonitoring.TaskRunner.BeginNextTask(String queueId, ICommand command)
   at Gallio.UI.ProgressMonitoring.TaskRunner.RunTask(String queueId)
   at Gallio.UI.ProgressMonitoring.TaskManager.QueueTask(String queueId, ICommand command)
   at Gallio.Icarus.Controllers.ExecutionLogController.Update()
   at Gallio.Icarus.Controllers.ExecutionLogController.Handle(TestStepFinished event)
   at Gallio.UI.Events.EventHandlerProxy`1.Handle(T event)
   at Gallio.UI.Events.EventAggregator.Send[T](Object sender, T message)
   at Gallio.Icarus.Controllers.TestController.<>c__DisplayClass15.<WireUpTestStepFinished>b__14()
   at Gallio.UI.ProgressMonitoring.TaskManager.<>c__DisplayClass1.<BackgroundTask>b__0(Object cb)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

What version of the product are you using? On what operating system?
Latest, 3.2.3

Please provide any additional information below.

Original issue reported on code.google.com by Nathanae...@gmail.com on 7 Jun 2011 at 9:43

GoogleCodeExporter commented 9 years ago
This happens every 2 or 3 times I run build. Several hundred message boxes 
appear with the same error, forcing me to kill the process.

Original comment by Nathanae...@gmail.com on 7 Jun 2011 at 9:44

GoogleCodeExporter commented 9 years ago
Should have been fixed in 3.3.289 - can you give it a try?

Original comment by wayne.br...@gmail.com on 7 Jun 2011 at 1:14

GoogleCodeExporter commented 9 years ago
Where can I find 3.3.289?

Original comment by Nathanae...@gmail.com on 7 Jun 2011 at 1:22

GoogleCodeExporter commented 9 years ago
Daily builds can be found here:
http://ccnet.gallio.org/Distributables/

Original comment by Yann.Tre...@gmail.com on 7 Jun 2011 at 1:47

GoogleCodeExporter commented 9 years ago
I've been using 3.2.289 all day, no issues until just now. Whatever was fixed 
reduced the frequency. Error below:

System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Gallio.UI.ProgressMonitoring.TaskRunner.<>c__DisplayClass6.<BeginNextTask>b__4(IDictionary`2 tasks)
   at Gallio.Common.Concurrency.LockBox`1.Write(WriteAction`1 action) in c:\Server\Projects\MbUnit v3.3\Work\src\Gallio\Gallio\Common\Concurrency\LockBox.cs:line 82
   at Gallio.UI.ProgressMonitoring.TaskRunner.BeginNextTask(String queueId, ICommand command)
   at Gallio.UI.ProgressMonitoring.TaskRunner.RunTask(String queueId)
   at Gallio.UI.ProgressMonitoring.TaskManager.QueueTask(String queueId, ICommand command)
   at Gallio.Icarus.Controllers.ExecutionLogController.Update()
   at Gallio.Icarus.Controllers.ExecutionLogController.Handle(TestStepFinished event)
   at Gallio.UI.Events.EventHandlerProxy`1.Handle(T event)
   at Gallio.UI.Events.EventAggregator.Send[T](Object sender, T message)
   at Gallio.Icarus.Controllers.TestController.<>c__DisplayClass15.<WireUpTestStepFinished>b__14()
   at Gallio.UI.ProgressMonitoring.TaskManager.<>c__DisplayClass1.<BackgroundTask>b__0(Object cb)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Original comment by Nathanae...@gmail.com on 7 Jun 2011 at 10:07