Bug 5108 - Many incorrectly implemented finalizers in MD
Summary: Many incorrectly implemented finalizers in MD
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-05-15 21:33 UTC by Mikayla Hutchinson [MSFT]
Modified: 2017-08-24 21:03 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Mikayla Hutchinson [MSFT] 2012-05-15 21:33:33 UTC
The following classes have finalizers or Dispose overrides that allow the finalizer thread to touch other instances of objects. This is bad because the other objects may have been finalized first, especially during program shutdown, when all finalizable objects are finalized. Some *may* be acceptable but their assumptions need to be explicitly commented as having been audited, since it's a violation of ~every guideline on the topic.

A couple call into remoting, which is particularly suspicious and likely to cause problems.

main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/LocalConsole.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeCompletion/MutableCompletionDataList.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs
main/src/addins/MonoDevelop.GtkCore2/libsteticui/Metacity/Preview.cs
main/src/core/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs
main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/MemoryProbe.cs
main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs
main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport/ToolboxService.cs
Comment 1 Miguel de Icaza [MSFT] 2012-05-19 00:29:03 UTC
CCing Lluis and Mike.

Guys, could you review the classes discusssed by Michael for the code you own, as it seems that some of these usage patterns can cause trouble down the line.
Comment 2 Mike Krüger 2012-06-01 06:03:34 UTC
btw

main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
is fixed.


main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Serialization/CodeCompletionDatabase.cs

Is removed - that was an old legacy file - it's unused since some time and wasn't even included in the project.
Comment 3 Will Smith 2017-08-24 21:03:08 UTC
Thanks so much for taking the time to submit this report! I attempted to reproduce this issue based on the bug description with the latest Visual Studio 2017 for Mac Preview version 7.2, and I was unable to hit the problem. If this issue is still occurring for you, please reopen this report and attach a reproduction, ideally starting with a new template project and then adding just the code necessary to demonstrate the issue.