[Mono-bugs] [Bug 573119] New: Exceptions throw in finalizer seem to be ignored on mono but not on .NET

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 22 12:42:13 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=573119

http://bugzilla.novell.com/show_bug.cgi?id=573119#c0


           Summary: Exceptions throw in finalizer seem to be ignored on
                    mono but not on .NET
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.4.x
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tom_hindle at sil.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=338373)
 --> (http://bugzilla.novell.com/attachment.cgi?id=338373)
test case

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0; GTB6.3; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR
3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

class Program
{
        static void Main(string[] args)
        {            
            for (int i = 0; i < 100; ++i)
            {
                new Program();
                GC.Collect();
            }            
        }

        ~Program()
        {
            Console.WriteLine("~Progam");
            throw new ApplicationException("2");
            Console.WriteLine("After ");
        }
}

Reproducible: Always

Steps to Reproduce:
1. Compile and run attached test case

Actual Results:  
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam
~Progam

etc...

Expected Results:  
~Progam

Unhandled Exception: System.ApplicationException: 2
   at ConsoleApplication1.Program.Finalize()
Press any key to continue . . .

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list