Bug 12435 - Exceptions being thrown in a finalizer
Summary: Exceptions being thrown in a finalizer
Status: RESOLVED DUPLICATE of bug 10883
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: unspecified
Hardware: PC Mac OS
: High major
Target Milestone: master
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-28 15:09 UTC by Alan McGovern
Modified: 2013-12-11 00:15 UTC (History)
3 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 DUPLICATE of bug 10883

Description Alan McGovern 2013-05-28 15:09:14 UTC
I have no idea what the trigger for this is, but i see it several times a day. We probably should not be disposing stuff from the finalizer thread.

System.ObjectDisposedException: The object was used after being disposed.
  at System.IO.FileStream.Write (System.Byte[] array, Int32 offset, Int32 count) [0x000aa] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.IO/FileStream.cs:634 
  at System.IO.StreamWriter.FlushBytes () [0x00043] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.IO/StreamWriter.cs:222 
  at System.IO.StreamWriter.Decode () [0x0000c] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.IO/StreamWriter.cs:229 
  at System.IO.StreamWriter.FlushCore () [0x00000] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.IO/StreamWriter.cs:201 
  at System.IO.StreamWriter.Flush () [0x00006] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.IO/StreamWriter.cs:195 
  at System.IO.StreamWriter.Dispose (Boolean disposing) [0x00012] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.IO/StreamWriter.cs:178 
  at System.IO.StreamWriter.Close () [0x00000] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/corlib/System.IO/StreamWriter.cs:367 
  at System.Diagnostics.Process.Dispose (Boolean disposing) [0x000a2] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/System/System.Diagnostics/Process.cs:1581 
  at MonoDevelop.Core.Execution.ProcessWrapper.Dispose (Boolean disposing) [0x0007a] in /Users/alan/Projects/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs:118 
  at System.Diagnostics.Process.Finalize () [0x00000] in /private/tmp/source/bockbuild-crypto-mono/profiles/mono-mac-xamarin/build-root/mono-3.0.10/mcs/class/System/System.Diagnostics/Process.cs:1601
Comment 1 Alan McGovern 2013-12-10 17:05:52 UTC
This is still an issue and I see it several times an hour when interacting with the iOS simulator. I'm bumping the severity as this is a very embarrassing issue to still have. It's a very frequent exception being shown to the user.


Can someone put a try/catch around the relevant thing, or just remove the unnecessary finalizers?
Comment 2 Mikayla Hutchinson [MSFT] 2013-12-11 00:15:35 UTC

*** This bug has been marked as a duplicate of bug 10883 ***