Skip to content

Instantly share code, notes, and snippets.

@spouliot
Created August 3, 2011 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spouliot/1122565 to your computer and use it in GitHub Desktop.
Save spouliot/1122565 to your computer and use it in GitHub Desktop.
Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) System.Diagnostics.FileVersionInfo:GetVersionInfo_internal (string)' while running with --aot-only.
at System.Diagnostics.FileVersionInfo.GetVersionInfo (System.String fileName) [0x00000] in <filename unknown>:0
at Keychain.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x000d2] in /Users/sebastienpouliot/git/monotouch-samples/Keychain/Keychain/Main.cs:55
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0
at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] in <filename unknown>:0
at Keychain.Application.Main (System.String[] args) [0x00000] in /Users/sebastienpouliot/git/monotouch-samples/Keychain/Keychain/Main.cs:17
[ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) System.Diagnostics.FileVersionInfo:GetVersionInfo_internal (string)' while running with --aot-only.
at System.Diagnostics.FileVersionInfo.GetVersionInfo (System.String fileName) [0x00000] in <filename unknown>:0
at Keychain.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x000d2] in /Users/sebastienpouliot/git/monotouch-samples/Keychain/Keychain/Main.cs:55
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0
at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] in <filename unknown>:0
at Keychain.Application.Main (System.String[] args) [0x00000] in /Users/sebastienpouliot/git/monotouch-samples/Keychain/Keychain/Main.cs:17
Terminating runtime due to unhandled exception
Stacktrace:
Native stacktrace:
0 Keychain 0x00170e40 mono_handle_native_sigsegv + 412
1 Keychain 0x0019802c sigabrt_signal_handler + 148
2 libsystem_c.dylib 0x35e5072f _sigtramp + 42
3 libsystem_c.dylib 0x35e453bb pthread_kill + 58
4 libsystem_c.dylib 0x35e3dbff abort + 78
5 Keychain 0x002acf8c monoeg_g_logv + 248
6 Keychain 0x002ad020 monoeg_assertion_message + 44
7 Keychain 0x00151a04 mono_thread_abort + 224
8 Keychain 0x00170288 mono_handle_exception_internal + 2436
9 Keychain 0x00170b70 mono_handle_exception + 108
10 Keychain 0x00196040 mono_arm_throw_exception + 324
11 Keychain 0x0010724c throw_exception + 48
12 Keychain 0x001549d8 mono_jit_compile_method + 136
13 Keychain 0x0023f1d8 mono_compile_method + 84
14 Keychain 0x00153650 mono_jit_compile_method_inner + 504
15 Keychain 0x00154770 mono_jit_compile_method_with_opt + 612
16 Keychain 0x00154984 mono_jit_compile_method + 52
17 Keychain 0x00169e10 mono_aot_plt_resolve + 316
18 Keychain 0x001734e4 mono_aot_plt_trampoline + 92
19 Keychain 0x00106c60 generic_trampoline_aot_plt + 136
20 Keychain 0x00033a98 Keychain_AppDelegate_FinishedLaunching_MonoTouch_UIKit_UIApplication_MonoTouch_Foundation_NSDictionary + 1580
21 Keychain 0x000dc78c wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
22 Keychain 0x00155aa8 mono_jit_runtime_invoke + 2800
23 Keychain 0x002455e8 mono_runtime_invoke + 140
24 Keychain 0x002cba20 monotouch_trampoline + 2840
25 UIKit 0x32454821 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 772
26 UIKit 0x3244eb65 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 272
27 UIKit 0x324237d7 -[UIApplication handleEvent:withNewEvent:] + 1114
28 UIKit 0x32423215 -[UIApplication sendEvent:] + 44
29 UIKit 0x32422c53 _UIApplicationHandleEvent + 5090
30 GraphicsServices 0x356fbe77 PurpleEventCallback + 666
31 CoreFoundation 0x3289da97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
32 CoreFoundation 0x3289f83f __CFRunLoopDoSource1 + 166
33 CoreFoundation 0x328a060d __CFRunLoopRun + 520
34 CoreFoundation 0x32830ec3 CFRunLoopRunSpecific + 230
35 CoreFoundation 0x32830dcb CFRunLoopRunInMode + 58
36 UIKit 0x3244dd49 -[UIApplication _run] + 372
37 UIKit 0x3244b807 UIApplicationMain + 670
38 Keychain 0x0001e248 wrapper_managed_to_native_MonoTouch_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 240
39 Keychain 0x0000ef00 MonoTouch_UIKit_UIApplication_Main_string__ + 36
40 Keychain 0x00033c38 Keychain_Application_Main_string__ + 128
41 Keychain 0x000dc78c wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 200
42 Keychain 0x00155aa8 mono_jit_runtime_invoke + 2800
43 Keychain 0x002455e8 mono_runtime_invoke + 140
44 Keychain 0x00248598 mono_runtime_exec_main + 784
45 Keychain 0x002475fc mono_runtime_run_main + 1048
46 Keychain 0x0015e0d0 mono_jit_exec + 216
47 Keychain 0x0015025c main + 4692
48 Keychain 0x00002d48 start + 40
Debug info from gdb:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
@spouliot
Copy link
Author

spouliot commented Aug 3, 2011

imac:Keychain sebastienpouliot$ nm Keychain/bin/iPhone/Debug/Keychain.app/Keychain | grep GetProcess_internal
00003770 t plt_System_Diagnostics_Process_GetProcess_internal_int
00003760 t plt__icall_native_System_Diagnostics_Process_GetProcess_internal_int
00002974 t wrapper_managed_to_native_System_Diagnostics_Process_GetProcess_internal_int

@spouliot
Copy link
Author

spouliot commented Aug 3, 2011

oops, above is a second test case - with another icall used from System.dll
here's the one for the above stack trace:

imac:Keychain sebastienpouliot$ nm Keychain/bin/iPhone/Debug/Keychain.app/Keychain | grep GetVersionInfo_internal
00003a90 t plt_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal_string
00003a20 t plt__icall_native_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal_string
00002e7c t wrapper_managed_to_native_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal_System_Diagnostics_FileVersionInfo_string

@spouliot
Copy link
Author

spouliot commented Aug 3, 2011

commit 0034a30869848042daa26adef20c7ab5a2ed7b2d
Author: Sebastien Pouliot sebastien@xamarin.com
Date: Tue Aug 2 16:30:16 2011 -0400

Do not define DISABLE_PROCESS_HANDLING since this will remove some icalls that the class librairies requires - e.g. regression from #709278

diff --git a/builds/Makefile b/builds/Makefile
index 6a83449..e92c08a 100644
--- a/builds/Makefile
+++ b/builds/Makefile
@@ -227,7 +227,7 @@ PLATFORM_SDK=$(PLATFORM_ROOT)/Developer/SDKs/iPhoneOS${IPHONEOS_VERSION}.sdk/

define PlatformBuildTemplate

-$(eval $(2)_CPPFLAGS=-arch $(1) $(3) -DSMALL_CONFIG -DDISABLE_POLICY_EVIDENCE=1 -DDISABLE_PROCESS_HANDLING=1 -D_XOPEN_SOURCE -DMONOTOUCH=1 -gdwarf-2 -miphoneos-version-min=3.0 -isysroot ${PLATFORM_SDK})
+$(eval $(2)_CPPFLAGS=-arch $(1) $(3) -DSMALL_CONFIG -DDISABLE_POLICY_EVIDENCE=1 -D_XOPEN_SOURCE -DMONOTOUCH=1 -gdwarf-2 -miphoneos-version-min=3.0 -isysroot ${PLATFORM_SDK})
$(eval $(2)_CFLAGS=$(PROFILE_CFLAGS) $($(2)_CPPFLAGS))
$(eval $(2)_CXXFLAGS=$(PROFILE_CFLAGS) $($(2)_CPPFLAGS))
$(eval $(2)_CONFIGURE_FLAGS=--build=i386-apple-darwin10 \

@spouliot
Copy link
Author

spouliot commented Aug 3, 2011

diff --git a/mono/metadata/icall-def.h b/mono/metadata/icall-def.h
index 5af43ff..6f61239 100644
--- a/mono/metadata/icall-def.h
+++ b/mono/metadata/icall-def.h
@@ -174,10 +174,10 @@ ICALL(DEBUGR_1, "IsAttached_internal", ves_icall_System_Diagnostics_Debugger_IsA
ICALL_TYPE(TRACEL, "System.Diagnostics.DefaultTraceListener", TRACEL_1)
ICALL(TRACEL_1, "WriteWindowsDebugString", ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString)

-#ifndef DISABLE_PROCESS_HANDLING
ICALL_TYPE(FILEV, "System.Diagnostics.FileVersionInfo", FILEV_1)
ICALL(FILEV_1, "GetVersionInfo_internal(string)", ves_icall_System_Diagnostics_FileVersionInfo_GetVersionInfo_internal)

+#ifndef DISABLE_PERFCOUNTERS
ICALL_TYPE(PERFCTR, "System.Diagnostics.PerformanceCounter", PERFCTR_1)
ICALL(PERFCTR_1, "FreeData", mono_perfcounter_free_data)
ICALL(PERFCTR_2, "GetImpl", mono_perfcounter_get_impl)
@@ -193,7 +193,9 @@ ICALL(PERFCTRCAT_5, "GetCategoryNames", mono_perfcounter_category_names)
ICALL(PERFCTRCAT_6, "GetCounterNames", mono_perfcounter_counter_names)
ICALL(PERFCTRCAT_7, "GetInstanceNames", mono_perfcounter_instance_names)
ICALL(PERFCTRCAT_8, "InstanceExistsInternal", mono_perfcounter_instance_exists)
+#endif /* DISABLE_PERFCOUNTERS */

+#ifndef DISABLE_PROCESS_HANDLING
ICALL_TYPE(PROCESS, "System.Diagnostics.Process", PROCESS_1)
ICALL(PROCESS_1, "CreateProcess_internal(System.Diagnostics.ProcessStartInfo,intptr,intptr,intptr,System.Diagnostics.Process/ProcInfo&)", ves_icall_System_Diagnostics_Process_CreateProcess_internal)
ICALL(PROCESS_2, "ExitCode_internal(intptr)", ves_icall_System_Diagnostics_Process_ExitCode_internal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment