[Mono-dev] Crash in call to internalGetHome()

Kamal Aboul-Hosn kamal at sooloos.com
Thu Dec 22 09:30:41 EST 2011


Hello, Mono folk,

I am manually compiling and running Mono on the Android platform and seem to have run into a crash. A call to Environment.GetFolderPath results in the following stacktrace:


I/stderr  (10642):   at System.Environment.UnixGetFolderPath (System.Environment/SpecialFolder,System.Environment/SpecialFolderOption) [0x00000] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:546
I/stderr  (10642):   at System.Environment.GetFolderPath (System.Environment/SpecialFolder,System.Environment/SpecialFolderOption) [0x00018] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:491
I/stderr  (10642):   at System.Environment.GetFolderPath (System.Environment/SpecialFolder) [0x00000] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:477
I/stderr  (10642):   at Test.Main () <0x0000b>
I/stderr  (10642):   at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <IL 0x0004c, 0xffffffff>
E/mono    (10642): 
E/mono    (10642): Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
E/mono    (10642):   at System.Environment.UnixGetFolderPath (SpecialFolder folder, SpecialFolderOption option) [0x00000] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:546 
E/mono    (10642):   at System.Environment.GetFolderPath (SpecialFolder folder, SpecialFolderOption option) [0x00018] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:491 
E/mono    (10642):   at System.Environment.GetFolderPath (SpecialFolder folder) [0x00000] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:477 
E/mono    (10642):   at Test.Main () [0x00000] in <filename unknown>:0 
I/stderr  (10642): [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
I/stderr  (10642):   at System.Environment.UnixGetFolderPath (SpecialFolder folder, SpecialFolderOption option) [0x00000] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:546 
I/stderr  (10642):   at System.Environment.GetFolderPath (SpecialFolder folder, SpecialFolderOption option) [0x00018] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:491 
I/stderr  (10642):   at System.Environment.GetFolderPath (SpecialFolder folder) [0x00000] in /Users/kamal/Downloads/mono-2.10.7/mcs/class/corlib/System/Environment.cs:477 
I/stderr  (10642):   at Test.Main () [0x00000] in <filename unknown>:0 


The problem line is this one in Environment.cs:


string home = internalGetHome ();


I see that internalGetHome is defined as an extern internalCall function. Is there perhaps something I am missing with regard to all the elements I need to install to make it work? I compile libmonosgen-2.0.a for Android on arm. Loading and running the following simple example via mono_jit_exec yields the above stacktrace:


using System; 

class Test 
{ 
     static void Main () 
     { 
         Console.WriteLine (Environment.GetFolderPath(Environment.SpecialFolder.Personal)); 
     } 
}


Any insight you could offer would be much appreciated.

Regards,

Kamal


More information about the Mono-devel-list mailing list