[Mono-bugs] [Bug 76062][Nor] New - Attribute .ctor's overactively executed

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Sep 11 15:53:28 EDT 2005


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 bmaurer at users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=76062

--- shadow/76062	2005-09-11 15:53:28.000000000 -0400
+++ shadow/76062.tmp.3301	2005-09-11 15:53:28.000000000 -0400
@@ -0,0 +1,118 @@
+Bug#: 76062
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: bmaurer at users.sf.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Attribute .ctor's overactively executed
+
+using System;
+
+class XAttribute : Attribute {
+	public XAttribute () 
+	{
+		throw new Exception ("X");
+	}
+}
+
+class ZAttribute : Attribute {
+}
+
+[X, Z]
+class Y {
+	static void Main () 
+	{
+		Console.WriteLine ("Z");
+		Console.WriteLine (typeof (Y).IsDefined (typeof (ZAttribute), true));
+		Console.WriteLine ("X");
+		Console.WriteLine (typeof (Y).IsDefined (typeof (XAttribute), true));
+
+		Console.WriteLine (typeof (Y).GetCustomAttributes (typeof (ZAttribute),
+true).Length);
+		Console.WriteLine (typeof (Y).GetCustomAttributes (true).Length);
+	}
+}
+
+In msft, only the last call to GetCustomAttributes throws an exception. In
+mono, each one will result in an exception.
+
+I noticed this because I was using a third party system.web component
+without libgdiplus. I got this stack trace:
+
+System.Web.Compilation.ParseException: An exception was thrown by the type
+initializer for System.Drawing.GDIPlus --->
+System.TypeInitializationException: An exception was thrown by the type
+initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException:
+gdiplus.dll
+in (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
+(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
+in <0x000d2> System.Drawing.GDIPlus:.cctor ()--- End of inner
+exception stack trace ---
+
+in <0x00000> <unknown method>
+in <0x001a5> System.Drawing.Image:InitFromStream (System.IO.Stream
+stream)
+in <0x0001c> System.Drawing.Bitmap:.ctor (System.IO.Stream stream,
+Boolean useIcm)
+in (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
+(System.IO.Stream,bool)
+in <0x000b9>
+System.Drawing.ToolboxBitmapAttribute:GetImageFromResource (System.Type t,
+System.String imageName, Boolean large)
+in <0x0001a> System.Drawing.ToolboxBitmapAttribute:.ctor (System.Type t)
+in <0x00000> <unknown method>
+in (wrapper managed-to-native)
+System.MonoCustomAttrs:GetCustomAttributesInternal
+(System.Reflection.ICustomAttributeProvider,bool)
+in <0x0000f> System.MonoCustomAttrs:GetCustomAttributesBase
+(ICustomAttributeProvider obj)
+in <0x0007b> System.MonoCustomAttrs:GetCustomAttributes
+(ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit)
+in <0x00019> System.MonoType:GetCustomAttributes (System.Type
+attributeType, Boolean inherit)
+in <0x0001e> System.Web.UI.ControlBuilder:CreateBuilderFromType
+(System.Web.UI.TemplateParser parser, System.Web.UI.ControlBuilder
+parentBuilder, System.Type type, System.String tagName, System.String id,
+IDictionary attribs, Int32 line, System.String sourceFileName)
+in <0x000dd> System.Web.UI.ControlBuilder:CreateSubBuilder
+(System.String tagid, System.Collections.Hashtable atts, System.Type
+childType, System.Web.UI.TemplateParser parser, ILocation location)
+in <0x00315> System.Web.Compilation.AspGenerator:ProcessTag
+(System.String tagid, System.Web.Compilation.TagAttributes atts, TagType
+tagtype)--- End of inner exception stack trace ---
+
+in <0x003eb> System.Web.Compilation.AspGenerator:ProcessTag
+(System.String tagid, System.Web.Compilation.TagAttributes atts, TagType
+tagtype)
+in <0x00140> System.Web.Compilation.AspGenerator:TagParsed (ILocation
+location, TagType tagtype, System.String tagid,
+System.Web.Compilation.TagAttributes attributes)
+in (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_ILocation_TagType_string_TagAttributes
+(System.Web.Compilation.ILocation,System.Web.Compilation.TagType,string,System.Web.Compilation.TagAttributes)
+in <0x00023> System.Web.Compilation.AspParser:OnTagParsed (TagType
+tagtype, System.String id, System.Web.Compilation.TagAttributes attributes)
+in <0x00186> System.Web.Compilation.AspParser:Parse ()
+in <0x0001d> System.Web.Compilation.AspGenerator:DoParse ()
+in <0x000d2> System.Web.Compilation.AspGenerator:GetCompiledType ()
+in <0x00029> System.Web.UI.PageParser:CompileIntoType ()
+in <0x00011> System.Web.UI.TemplateControlParser:GetCompiledInstance ()
+in <0x00035> System.Web.UI.PageParser:GetCompiledPageInstance
+(System.String virtualPath, System.String inputFile, System.Web.HttpContext
+context)
+in <0x00010> System.Web.UI.PageHandlerFactory:GetHandler
+(System.Web.HttpContext context, System.String requestType, System.String
+url, System.String path)
+in <0x001e1> System.Web.HttpApplication:GetHandler
+(System.Web.HttpContext context)
+in <0x00888> System.Web.HttpApplication+<Pipeline>__1:MoveNext ()


More information about the mono-bugs mailing list