Bug 14515 - ParallelEnumerable.Range() yields incorrect values when "start" parameter > 1
Summary: ParallelEnumerable.Range() yields incorrect values when "start" parameter > 1
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Core (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2013-09-07 01:11 UTC by karlvonl
Modified: 2013-09-09 03:15 UTC (History)
2 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description karlvonl 2013-09-07 01:11:10 UTC
When calling ParallelEnumerable.Range(start, count) where start > 1, the enumerator yields incorrect values. Specifically, any value that would be greater than count is replaced by -1.

This program illustrates the error:

// ---------------------------------------------------------
using System;
using System.Linq;

public class Test
{
  static public void Main ()
  {
    Console.WriteLine("start = 0:");
    foreach (int n in ParallelEnumerable.Range(0, 10)) {
      Console.WriteLine(n);
    }

    Console.WriteLine("start = 5:");
    foreach (int n in ParallelEnumerable.Range(5, 10)) {
      Console.WriteLine(n);
    }

    Console.WriteLine("start = 30:");
    foreach (int n in ParallelEnumerable.Range(30, 10)) {
      Console.WriteLine(n);
    }
  }
}
// ---------------------------------------------------------

And this is the output:

start = 0:
0
5
1
2
3
4
6
7
8
9
start = 5:
5
6
7
8
9
10
-1
-1
-1
-1
start = 30:
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1

I am using Mono 3.2.1 on Mac OS X 10.7.5 (Lion).

Mono JIT compiler version 3.2.1 ((no/f3f789e Tue Jul 30 00:31:23 EDT 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  x86
	Disabled:      none
	Misc:          softdebug 
	LLVM:          yes(3.3svn-mono)
	GC:            sgen
Comment 1 Marek Safar 2013-09-09 03:13:03 UTC
Fixed in master