Bug 21388

Summary: DeclaringType property getter on a GenericParameter crashes the VM (in certain cases)
Product: [Mono] Runtime Reporter: gderou
Component: ReflectionAssignee: Rodrigo Kumpera <kumpera>
Status: RESOLVED FIXED    
Severity: normal CC: kumpera, mono-bugs+runtime, vargaz
Priority: ---    
Version: 3.2.x   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Simple program that reproduces the bug

Description gderou 2014-07-17 04:21:51 UTC
Created attachment 7405 [details]
Simple program that reproduces the bug

The included program, when run with Mono 3.2.3 (downloaded from http://download.mono-project.com/archive/3.2.3/windows-installer/mono-3.2.3-gtksharp-2.12.11-win32-0.exe) crashes silently (no exception thrown).

The same program when run with MS .Net produces the following output:
    DeclaringType is TestMono.GenericClass`1[T]
    Type found T

The issue seems to come from the fact that the type was retrieved from the LocalVariableInfo via reflection.
Comment 1 Zoltan Varga 2014-07-17 16:05:21 UTC
This is reproducible with mono master on osx.
Comment 2 Rodrigo Kumpera 2014-07-20 22:02:42 UTC
Working on it.
Comment 3 Rodrigo Kumpera 2014-07-21 17:58:50 UTC
Fixed in master/19940950495764be30a85b91392dbaed8e05af35