Bug 4082 - Infinite loop with AsOrdered() in Parallel LINQ
Summary: Infinite loop with AsOrdered() in Parallel LINQ
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Core ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Jérémie Laval
Depends on:
Reported: 2012-03-24 16:08 UTC by Neil Stalker
Modified: 2012-04-11 09:56 UTC (History)
2 users (show)

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

An example (1.69 KB, text/x-csharp)
2012-03-24 16:08 UTC, Neil Stalker

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 Neil Stalker 2012-03-24 16:08:05 UTC
Created attachment 1574 [details]
An example

When using AsOrdered() or orderby with Parallel LINQ the code goes into an infinite loop.

This causes the following 19 unit tests in ParallelEnumerableTests.cs to hang when they are run:
TestSkip ()
TestSkipIterating ()
TestSkipWhile ()
TestTake ()
TestTakeWhile ()
SelectManyOrderedTest ()
TestLast ()
TestLastOrDefault ()
TestFirst ()
TestFirstOrDefault ()
TestReverse ()
TestOrderBy ()
TestOrderByAgeAscendingTheByNameDescending ()
TestOrderByIdDescendingThenByNameAscending ()
TestToListOrdered ()
TestToArrayOrdered ()

Comment 1 Jérémie Laval 2012-04-10 12:05:11 UTC
Hey Neil,

What version of Mono are you using? Unit tests have been running fine for us and I checked your attachment which works too here (mono master).

Could you also attach /proc/cpuinfo content please?
Comment 2 Neil Stalker 2012-04-10 14:31:11 UTC
I have rerun the tests on the latest git and the tests now pass.

Looking at the history for these tests on wrench (http://wrench.mono-project.com/Wrench/ViewWorkTable.aspx?lane_id=14&host_id=10&command_id=214) it looks like the issue was fixed in a commit between the 28th march and the 5th April.

Bug can be closed.
Comment 3 Jérémie Laval 2012-04-11 09:56:18 UTC