Known Correctness Bugs with the Parallel Extensions CTP December 2007

Stephen Toub - MSFT

Here are known correctness bugs as of our December 2007 CTP release:

  • Common
    • The setup for Parallel Extensions may fail on Windows Server 2008 (both 32-bit and 64-bit).  As a workaround, Parallel Extensions may be installed manually:
      • From a prompt with administrator privileges: msiexec /a ParallelExtensions_Dec07CTP.msi TARGETDIR=”%TMP%ParallelExtensions” /qn
      • This extracts the contents of the MSI to the target folder. The System.Threading.dll can be GAC’d manually from there using the gacutil tool.
    • The spin waiting used in the libraries doesn’t always consider all runnable threads for switching due to dependency on SwitchToThread.
    • AggregateException.Flatten should recursively flatten all AggregateExceptions such that the final output contains no aggregates.
  • PLINQ
    • On an empty sequence, LINQ to Objects’ Min/Max will throw an exception whereas PLINQ’s will not.
    • Calling Dispose on a PLINQ enumerator does not always properly dispose of resources allocated by the query.
    • LINQ to Objects throws an exception when the predicate delegate passed to First is null; PLINQ does not.
    • Max(double.NaN, null) is returned as null using PLINQ and double.NaN using LINQ to Objects.
    • Calling Reset on an unopened enumerator throws a NullReferenceException.
    • Cast with order-preservation enabled doesn’t handle invalid casts.
    • ToArray(int[] lengths) does not handle dimension values of 0 correctly.
    • Union throws IndexOutOfRangeException when order-preservation is enabled
    • SkipWhile, TakeWhile, Select, SelectMany, Where incorrectly handle overflow conditions.
    • TakeWhile followed by Take hangs or throws an out of memory exception when used on an infinite enumerable.
    • Range incorrectly handles Int32.MaxValue.
    • ToArray on a null source throws a NullReferenceException rather than an ArgumentNullException as in LINQ to Objects.
    • No verification is performed on the PLINQ_DOP/PLINQ_PRESERVE_ORDER environment variables before parsing them.
    • Range partitioning fairness needs to be improved.  In certain cases, threads will be starved of work. For example, if input.Count = 9 and DOP = 8, PLINQ will partition input into partitions of sizes {2,2,2,2,1,0,0,0} instead of {2,1,1,1,1,1,1,1}.
    • SelectMany may throw out of memory exceptions for medium-to-large sized data sources.
    • PLINQ is designed to wrap all exceptions thrown from a query in an AggregateException, but sometimes unwrapped exceptions may escape.
  • Task Parallel Library
    • A rare race condition exists that causes some task joins to be missed.
    • The Value property on a Future<T> created with the parameterless Create method is supposed to block in its get accessor until the Value property has been set, but it doesn’t.
    • Worker threads are not cleaned up when the associated task manager is disposed.
    • Tasks blocked for significant periods of time may cause runaway thread injection and out of memory conditions when the default policy is used.
    • Task.CancelAndWait is supposed to eat the TaskCanceledException for the task being canceled, but it’s currently not doing so.
    • TaskManager(TaskManagerPolicy) should demand Infrastructure permission, not ControlEvidence and ControlPolicy.
    • The implementation of Task.Completed is incorrect and can lead to a completion handler being invoked more than once.
    • TaskCoordinator.WaitAll only works with Task[] (and not TaskCoordinator[] as documented and as exposed through the API).  This means it can’t currently be used with parameter arrays.
    • Task.IsCompleted may throw a NullReferenceException when used with self-replicating tasks.
    • TaskManager fails to initialize if execution context flow already suppressed.
    • Parallel.Do will hang if the associated TaskManager has been shutdown.
    • Task.Create(Action, string) conflicts with Task.Create(Action, object), in that a user may try to provide a string as the state to the action, but will end up naming the task instead.
    • ExecutionContext is not flowed correct through some asynchronous points
    • The threadLocalCleanup delegate provided to Parallel.ForEach may not be called. 
  • Samples
    • Most of the samples included with the CTP reference the wrong version number of System.Threading.dll, which will prevent the samples from compiling/executing.  A simple workaround is to remove the System.Threading reference from the sample project and then readd the reference.

0 comments

Discussion is closed.

Feedback usabilla icon