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 6438 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
We get the below stacktrace sometimes when changing a timer (Mono 2.10.x).
Problem is intermittent and hard to reproduce. Seen it mostly on mac and also I think I recall seeing it on android too.
I suspect it could be related to this commit?
Unfortunately I can't find bug #648130 to see why list.IndexOfKey is a no-no for the Scheduler.Add method, but I notice that IndexOfKey is still being used in Scheduler.InternalRemove. Is that possibly the problem?
Anyway, here's the stacktrace we get:
System.ArgumentException: Key 'System.Threading.Timer' already exists in list.
at System.Collections.SortedList.PutImpl (System.Object key, System.Object value, Boolean overwrite) [0x00000] in <filename unknown>:0
at System.Collections.SortedList.Add (System.Object key, System.Object value) [0x00000] in <filename unknown>:0
at System.Threading.Timer+Scheduler.Add (System.Threading.Timer timer) [0x00000] in <filename unknown>:0
at System.Threading.Timer+Scheduler.Change (System.Threading.Timer timer, Int64 new_next_run) [0x00000] in <filename unknown>:0
at System.Threading.Timer.Change (Int64 dueTime, Int64 period, Boolean first) [0x00000] in <filename unknown>:0
at System.Threading.Timer.Change (Int64 dueTime, Int64 period) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Threading.Timer:Change (long,long)