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.
1) GCHandles are not reported as such [attaching patch]
2) Pinned roots are reported as stack roots [attaching patch]
3) Static fields are reported as unknown roots.
Bug #386 has a test case (in the first comment) that reproduces at least 1) and 2).
Created attachment 1064 [details]
sgen: Don't report all pinned roots as stack roots.
This just avoids confusing by reporting most roots as unknown roots instead of stack roots. A better fix would of course be to report more(exact?) information about where the roots come from.
Created attachment 1065 [details]
sgen: Report gchandle roots as such when profiling
This patch does not handle locking (I don't know the exact requirements).
TODO: maybe distinguish between the different types of GCHandles when reporting them to the profiler?
Paolo, I know this isn't what you proposed (which was to give sgen a pointer to the gc_handles array, so sgen could traverse it instead), but this seemed like an easier way (as in less code changed/shuffled around).
I'll implement the exporting of the handle arrays next week: the first patch is fine to commit, the second is not, as it doesn't help us move in the right direction and the added function doesn't have very useful semantics imho.
Paolo, did you finish the work on this?
Wow, we finally have a PR for this, only 6 years late.