[Mono-bugs] [Bug 54997][Wis] New - Calling GetCustomAttributes on ParameterInfo leads to assertion failed error for not yet saved assemblies generated with reflection emit

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 29 Feb 2004 07:18:13 -0500 (EST)


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 dominic_ullmann@hispeed.ch.

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

--- shadow/54997	2004-02-29 07:18:13.000000000 -0500
+++ shadow/54997.tmp.31635	2004-02-29 07:18:13.000000000 -0500
@@ -0,0 +1,81 @@
+Bug#: 54997
+Product: Mono/Runtime
+Version: unspecified
+OS: SuSE 8.1
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dominic_ullmann@hispeed.ch               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Calling GetCustomAttributes on ParameterInfo leads to assertion failed error for not yet saved assemblies generated with reflection emit
+
+Description of Problem:
+
+It's not possible to query custom attributes on method parameters for 
+methods generated at runtime with reflection emit, before the assembly has 
+been saved to disk.
+Calling GetCustomAttributes() on the ParameterInfo leads to the following 
+error message:
+
+** ERROR **: file metadata.c: line 909 (mono_metadata_decode_row_col): 
+assertion failed: (col < mono_metadata_table_count (bitfield))
+aborting...
+Aborted
+
+Steps to reproduce the problem:
+1. compile the attachted file Test.cs with mcs: mcs Test.cs
+2. run the demo: mono Test.exe
+
+Actual Results:
+
+Output from Test.exe:
+---------------------
+generated successfully
+investigate type in non-saved:
+get parameter infos from method: System.Int32[] method1(System.Int16[])
+pInfo.Length:1
+param0-type: System.Int16[]
+return type: System.Int32[]
+get custom attributes
+
+** ERROR **: file metadata.c: line 909 (mono_metadata_decode_row_col): 
+assertion
+ failed: (col < mono_metadata_table_count (bitfield))
+aborting...
+Aborted
+
+Expected Results:
+Demo should not crash; It works fine with MS.NET
+
+Expected output from Test.exe:
+------------------------------
+generated successfully
+investigate type in non-saved:
+get parameter infos from method: Int32[] method1(Int16[])
+pInfo.Length:1
+param0-type: System.Int16[]
+return type: System.Int32[]
+get custom attributes
+pAttrs.Length: 1
+rt custom attributes length: 1
+investigate type in saved:
+get parameter infos from method: Int32[] method1(Int16[])
+pInfo.Length:1
+param0-type: System.Int16[]
+return type: System.Int32[]
+get custom attributes
+pAttrs.Length: 1
+rt custom attributes length: 1
+
+
+How often does this happen? 
+every time.
+
+Additional Information: