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
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.
Created attachment 1252 [details]
The internal class ObjectPool<T> in the System.Concurrent library has an infinite loop. The loop occurs when 134217728 invocations of the Take() function have been called and a Release(obj) is subsequently called. Due to using 0x8000000 to signal changing state this limitation of 134217728 Take/Release's exists.
The limitation is one thing, but there is a loop in Release() that has no "tries" like the outer loop, such that will loop forever in this scenario.
Find a patch enclosed (I tested in my own class, but could not build to test in-situ, so may be an error in the patch, please test).
I changed the code to use a long for the indexing with now 0x0800000000000000 as the signal bit. I also added a "tries" to the inner loop so will never become infinite. I suppose in the case of the new bit, this is not a real possibility.
ObjectPool code was full of issues so we killed it.