Bug 30085 - Type.GetType(typeName) crash when typeName is generic type with invalid argument type
Summary: Type.GetType(typeName) crash when typeName is generic type with invalid argum...
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection ()
Version: 4.0.0
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-14 12:59 UTC by vitalius.marcinkevicius
Modified: 2015-05-29 12:22 UTC (History)
5 users (show)

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

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:
Status:
RESOLVED FIXED

Description vitalius.marcinkevicius 2015-05-14 12:59:18 UTC
class Program
{
    static void Main()
    {
        System.Console.WriteLine("Ok: " + System.Type.GetType("System.Nullable`1[[System.Int32, mscorlib]]"));
        System.Console.WriteLine("Expecting null: " + System.Type.GetType("System.Nullable`1[[System.Int32, mscorlibBAD]]"));
    }
}

There is output:

sh-4.3# mono main.exe                                                                                                                                                                                                                                   
Ok: System.Nullable`1[System.Int32]                                                                                                                                                                                                                     
Stacktrace:                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                        
  at <unknown> <0xffffffff>                                                                                                                                                                                                                             
  at (wrapper managed-to-native) System.Type.internal_from_name (string,bool,bool) <0xffffffff>                                                                                                                                                         
  at System.Type.GetType (string) <0x0001b>                                                                                                                                                                                                             
  at Program.Main () <0x0003f>                                                                                                                                                                                                                          
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>                                                                                                                                                     
                                                                                                                                                                                                                                                        
Native stacktrace:                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                        
        mono() [0x5148d6]                                                                                                                                                                                                                               
        mono() [0x57a773]                                                                                                                                                                                                                               
        mono() [0x48ed40]                                                                                                                                                                                                                               
        /lib64/libpthread.so.0(+0x100d0) [0x7fc5ae56a0d0]                                                                                                                                                                                               
        mono() [0x627fe8]                                                                                                                                                                                                                               
        mono() [0x627baf]                                                                                                                                                                                                                               
        mono() [0x627e43]                                                                                                                                                                                                                               
        mono() [0x5adc48]                                                                                                                                                                                                                               
        [0x4098b2be]                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                        
Debug info from gdb:                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        
=================================================================                                                                                                                                                                                       
Got a SIGSEGV while executing native code. This usually indicates                                                                                                                                                                                       
a fatal error in the mono runtime or one of the native libraries                                                                                                                                                                                        
used by your application.                                                                                                                                                                                                                               
=================================================================                                                                                                                                                                                       
                                                                                                                                                                                                                                                        
Aborted (core dumped)
Comment 1 Miguel de Icaza [MSFT] 2015-05-28 17:04:05 UTC
Pull request with discussion:

https://github.com/mono/mono/pull/1817

similar issue:

https://github.com/mono/mono/pull/1839
Comment 2 Rodrigo Kumpera 2015-05-29 12:22:36 UTC
Fixed in master.