Bug 21388 - DeclaringType property getter on a GenericParameter crashes the VM (in certain cases)
Summary: DeclaringType property getter on a GenericParameter crashes the VM (in certai...
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection ()
Version: 3.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Rodrigo Kumpera
Depends on:
Reported: 2014-07-17 04:21 UTC by gderou
Modified: 2014-07-21 17:58 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Simple program that reproduces the bug (594 bytes, text/plain)
2014-07-17 04:21 UTC, gderou

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

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