Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 43447 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 17068 [details]
Example code that produces this bug
During concurrent calls to Add and Remove on a SynchronizedCollection instance, Add throws an ArgumentOutOfRangeException with the message "Index must be within the bounds of the List. Parameter name: index".
This was with mono 4.4.1 originally, and a quick check of the code on your github master branch (https://github.com/mono/mono/blob/master/mcs/class/System.ServiceModel/System.Collections.Generic/SynchronizedCollection.cs) shows that this may be because Add reads its backing list's count outside of a lock, and passes that to InsertItem.
Example code attached. Reproduces almost every run with mono, never with .NET 4.6.