Bug 29343 - System.Linq.ParallelEnumerable.Aggregate throws ArgumentNullException on singleton array input
Summary: System.Linq.ParallelEnumerable.Aggregate throws ArgumentNullException on sing...
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 3.12.0
Hardware: PC All
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2015-04-23 12:01 UTC by Gian Ntzik
Modified: 2015-04-27 10:55 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Gian Ntzik 2015-04-23 12:01:34 UTC
# test sample
var xs = new int [] { 0 }
xs.AsParallel().Aggregate((l, x) => l + x)

# result
System.ArgumentNullException: Argument cannot be null.
Parameter name: seedFactory
  at System.Linq.ParallelEnumerable.Aggregate[Int32,Int32,Int32] (System.Linq.ParallelQuery`1 source, System.Func`1 seedFactory, System.Func`3 updateAccumulatorFunc, System.Func`3 combineAccumulatorsFunc, System.Func`2 resultSelector) [0x00000] in <filename unknown>:0 
  at System.Linq.ParallelEnumerable.Aggregate[Int32] (System.Linq.ParallelQuery`1 source, System.Func`3 func) [0x00000] in <filename unknown>:0 
  at <InteractiveExpressionClass>.Host (System.Object& $retval) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result, System.Boolean& result_set) [0x00000] in <filename unknown>:0 
  at Mono.CSharpShell.Evaluate (System.String input) [0x00000] in <filename unknown>:0 

#expected result

# system info:
mono version 3.12.1, Linux 3.13.0-49-generic #83-Ubuntu SMP Fri Apr 10 20:11:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Marek Safar 2015-04-27 10:55:24 UTC
Fixed in Mono 4.0