[Mono-bugs] [Bug 701562] New: AsymmetricAlgorithm violates IDispose pattern

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jun 22 08:34:29 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=701562

https://bugzilla.novell.com/show_bug.cgi?id=701562#c0


           Summary: AsymmetricAlgorithm violates IDispose pattern
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: i386
        OS/Version: Windows 7
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: j.schoot at divitec.nl
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User
           Blocker: ---


AsymmetricAlgorithm seems to violate the IDispose pattern. The base.Dispose()
function is called recursively and crashes on a stackoverflow.

Reproducible: Always

Steps to Reproduce:

using System;
using System.Security.Cryptography;

namespace AsymmetricalAlgorithm
{
    public class MyAsymmetricAlgorithm : AsymmetricAlgorithm
    {
        public override void FromXmlString(string xmlString)
        {
            throw new NotImplementedException();
        }

        public override string KeyExchangeAlgorithm
        {
            get { throw new NotImplementedException(); }
        }

        public override string SignatureAlgorithm
        {
            get { throw new NotImplementedException(); }
        }

        public override string ToXmlString(bool includePrivateParameters)
        {
            throw new NotImplementedException();
        }

        protected override void Dispose(bool disposing)
        {
            Console.WriteLine("call base.Dispose");
            base.Dispose(disposing);
            Console.WriteLine("MyAsymmetricAlgorithm.Dispose({0}) called",
disposing);

        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Start");
            using (var rsa = new MyAsymmetricAlgorithm())
            {

            }

            Console.WriteLine("Done");
        }

    }
}

-- 
Configure bugmail: https://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