Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=80899 --- shadow/80899 2007-02-19 14:29:08.000000000 -0500 +++ shadow/80899.tmp.6473 2007-02-19 14:29:08.000000000 -0500 @@ -0,0 +1,79 @@ +Bug#: 80899 +Product: Mono: Runtime +Version: 1.2 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: misc +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Finalizers not called anymore after an unhandled type load exception in a finalizer + +Finalizers not called anymore after an unhandled type load exception in a +finalizer. It can be reproduced with the following test app: + + +using System; + +public class Test +{ + public static void Main () + { + while (true) { + for (int n=0; n<10000; n++) + new WithFinalizer (); + + Console.WriteLine ("Live objects: " + WithFinalizer.ccount); + Console.ReadLine (); + } + } +} + +class WithFinalizer +{ + public static int ccount; + public static bool crash = true; + + public WithFinalizer () + { + ccount++; + } + + ~WithFinalizer () + { + ccount--; + if (crash && ccount == 5000) { + Console.WriteLine ("Crashing"); + crash = false; + new Crasher (); + } + } +} + +class Crasher +{ + static Crasher () + { + throw new Exception (); + } + + ~Crasher () + { + } +} + +The application creates sets of 10000 instance of WithFinalizer objects at +every Enter press. However, in the first run it will crash in a finalizer. +The crash happens when trying to create an instance of Crasher, which +throws an exception in the class constructor. After this crash, finalizers +are not called anymore. + +Notice that if the exception shown is a regular exception it does not +happen. It also does not happen if the Crasher class does not have a finalizer. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
