dotnet / BenchmarkDotNet

Powerful .NET library for benchmarking
https://benchmarkdotnet.org
MIT License
10.59k stars 970 forks source link

Bug: NRE possible on joining categories #2656

Open keegan-caruso opened 1 month ago

keegan-caruso commented 1 month ago

If --join is omitted, no error is thrown.

Repro:

Run this command:

 dotnet run -c Release -f net9.0 --join --anyCategories Linq

Over the micro benchmarks in dotnet/performance

Error message:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Linq.Enumerable.MaxInteger[TSource,TResult](IEnumerable`1 source, Func`2 selector)
   at BenchmarkDotNet.Reports.SummaryTable.SummaryTableColumn..ctor(SummaryTable table, Int32 index, IColumn column, Boolean hide)
   at BenchmarkDotNet.Reports.SummaryTable..ctor(Summary summary, SummaryStyle style)
   at BenchmarkDotNet.Reports.Summary.GetTable(SummaryStyle style)
   at BenchmarkDotNet.Reports.Summary..ctor(String title, ImmutableArray`1 reports, HostEnvironmentInfo hostEnvironmentInfo, String resultsDirectoryPath, String logFilePath, TimeSpan totalTime, CultureInfo cultureInfo, ImmutableArray`1 validationErrors, ImmutableArray`1 columnHidingRules, SummaryStyle summaryStyle)
   at BenchmarkDotNet.Reports.Summary.Join(List`1 summaries, ClockSpan clockSpan)
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo[] benchmarkRunInfos)
   at BenchmarkDotNet.Running.BenchmarkSwitcher.RunWithDirtyAssemblyResolveHelper(String[] args, IConfig config, Boolean askUserForInput)
   at BenchmarkDotNet.Running.BenchmarkSwitcher.Run(String[] args, IConfig config)
   at MicroBenchmarks.Program.Main(String[] args) in D:\forks\performance\src\benchmarks\micro\Program.cs:line 43
keegan-caruso commented 1 month ago

This was on v0.14.1-nightly.20240924.187 of BDN.