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 on
Developer Community or GitHub 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.
System.RankException: Arrays must be of same size.
at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00000] in <filename unknown>:0 (code.cs:1)
at System.Collections.Generic.Dictionary`2[System.Int32,Monosyne.Graphics.Glyph].Resize () [0x00000] in <filename unknown>:0 (code.cs:1)
at System.Collections.Generic.Dictionary`2[System.Int32,Monosyne.Graphics.Glyph].set_Item (Int32 key, Monosyne.Graphics.Glyph value) [0x00000] in <filename unknown>:0 (code.cs:1)
Please provide a test case that demonstrates the issue so we can fix it.
i believe my company pays enough to Xamarin (>50 enterprise licenses), so we can focus on writing our app, and not reproducing your bugs.
Unfortunately, with as little information as you provided here, there isn't anything we can do.
Can you share at least the full stacktrace? Or the code that uses that dictionary?
Is this a random problem ? Is that dictionary being used by multiple threads without locking ?
Shouldn't it throw InvalidOperationException if collection is modified from wrong thread ?
Dictionary-es are not thread safe so they don't detect such accesses.
As stated by Zoltan Varga, the C# Dictionary class is not thread safe and is unable to detect the type of access attempted here. However, the .NET Framework 4 introduces the System.Collections.Concurrent namespace, which includes several collection classes that are both thread-safe and scalable.
ConcurrentDictionary<TKey,TValue> is a thread-safe implementation of a dictionary of key-value pairs that should so the problem seen here. For more information, please see https://docs.microsoft.com/en-us/dotnet/standard/collections/thread-safe/
We are marking this issue as RESOLVED→ANSWERED. If you are still encountering this issue on the latest Xamarin.iOS 10.12.0.14, please don’t hesitate to reopen the ticket with the requested information. Thanks!