f790ba0272
This will hopefully make it easier to diagnose these kinds of crashes: Thread 0 Crashed: 0 libobjc.A.dylib 0x00000001a6f6e7f8 object_getClass + 48 1 MyTestDotNetApp.Net 0x0000000104b90a68 do_icall (interp.c:2273) 2 MyTestDotNetApp.Net 0x0000000104b8f838 do_icall_wrapper (interp.c:2361) 3 MyTestDotNetApp.Net 0x0000000104b85214 interp_exec_method (interp.c:3885) 4 MyTestDotNetApp.Net 0x0000000104b82de8 interp_runtime_invoke (interp.c:2122) 5 MyTestDotNetApp.Net 0x0000000104b4aedc mono_jit_runtime_invoke (mini-runtime.c:3650) 6 MyTestDotNetApp.Net 0x0000000104a8b874 mono_runtime_try_invoke (object.c:2415) 7 MyTestDotNetApp.Net 0x0000000104a8d8a0 mono_runtime_invoke (object.c:2464) 8 MyTestDotNetApp.Net 0x0000000104c42b68 native_to_managed_trampoline_68(objc_object*, objc_selector*, _MonoMethod**, objc_object*, unsigned int) (registrar.mm:4511) 9 MyTestDotNetApp.Net 0x0000000104c42a00 +[__NSObject_Disposer drain:] (registrar.mm:20968) 10 Foundation 0x00000001adc13b14 __NSThreadPerformPerform + 260 This happens because we try to access freed/invalid memory, but unfortunately the crash report / stack trace does not contain any hint whatsoever about the memory that triggered the crash. By adding an opt-in to validate the memory for a given object, we might be able to detect this crash in a few cases, and instead throw a managed exception with much more information. A project opts-in by setting `_ValidateObjectPointers=true` in the csproj. Ref: https://github.com/xamarin/xamarin-macios/issues/19493 --------- Co-authored-by: Manuel de la Pena <mandel@microsoft.com> |
||
---|---|---|
.. | ||
xamarin | ||
.gitignore | ||
COOP.md | ||
Delegates.cs.t4 | ||
EXCEPTIONS.md | ||
Makefile | ||
README.md | ||
Xamarin.framework-iphoneos.Info.plist | ||
Xamarin.framework-iphonesimulator.Info.plist | ||
Xamarin.framework-tvos.Info.plist | ||
Xamarin.framework-tvsimulator.Info.plist | ||
Xamarin.framework-watchos.Info.plist | ||
Xamarin.framework-watchsimulator.Info.plist | ||
bindings-generator.cs | ||
bindings-generator.csproj | ||
bindings.h | ||
bindings.m | ||
coreclr-bridge.m | ||
delegates.h.t4 | ||
delegates.inc.t4 | ||
delegates.t4 | ||
exports.t4 | ||
extension-main.m | ||
frameworks.h | ||
launcher.h | ||
launcher.m | ||
libmonotouch.csproj | ||
libxammac.csproj | ||
main-internal.h | ||
mono-runtime.h.t4 | ||
mono-runtime.m.t4 | ||
monotouch-debug.h | ||
monotouch-debug.m | ||
monotouch-main.m | ||
monotouch-support.h | ||
monovm-bridge.m | ||
nativeaot-bridge.m | ||
nsstring-localization.m | ||
product.in.h | ||
runtime-generated.h.t4 | ||
runtime-internal.h | ||
runtime.m | ||
shared.h | ||
shared.m | ||
slinked-list.h | ||
trampolines-arm64-asm.s | ||
trampolines-arm64-objc_msgSend.inc.s | ||
trampolines-arm64-objc_msgSend.s | ||
trampolines-arm64-objc_msgSendSuper.s | ||
trampolines-arm64.h | ||
trampolines-arm64.m | ||
trampolines-i386-asm.s | ||
trampolines-i386-objc_msgSend-copyframe.inc | ||
trampolines-i386-objc_msgSend-post.inc | ||
trampolines-i386-objc_msgSend-pre.inc | ||
trampolines-i386-objc_msgSend.s | ||
trampolines-i386-objc_msgSendSuper.s | ||
trampolines-i386-objc_msgSendSuper_stret.s | ||
trampolines-i386-objc_msgSend_stret.s | ||
trampolines-i386.h | ||
trampolines-i386.m | ||
trampolines-internal.h | ||
trampolines-invoke.m | ||
trampolines-varargs.h | ||
trampolines-varargs.m | ||
trampolines-x86_64-asm.s | ||
trampolines-x86_64-objc_msgSend-copyframe.inc | ||
trampolines-x86_64-objc_msgSend-post.inc | ||
trampolines-x86_64-objc_msgSend-pre.inc | ||
trampolines-x86_64-objc_msgSend.s | ||
trampolines-x86_64-objc_msgSendSuper.s | ||
trampolines-x86_64-objc_msgSendSuper_stret.s | ||
trampolines-x86_64-objc_msgSend_stret.s | ||
trampolines-x86_64.h | ||
trampolines-x86_64.m | ||
trampolines.m | ||
xamarin-support.m |
README.md
Native runtime
This directory contains the native runtime for Xamarin.iOS and Xamarin.Mac.
Cooperative GC
See COOP.md
Generated code
A few files are generated automatically:
delegates.h|inc, Delegates.cs
These files contain the code required to glue the native runtime and the managed runtime.
mono-runtime.m, xamarin/mono-runtime.h
These files contain code that makes other code, consumers of the mono runtime, oblivious to whether the mono runtime is linked statically, dynamically, or using dlopen at runtime.
If you need to use a new function from the Mono headers, add it to exports.t4.
If you need a new enum / constant / typedef / etc, add it to mono-runtime.h.t4.
Shipped headers
These are the headers shipped with XI/XM (they're not for public consumption, but we need them to build generated code on customers machine, in particular main.m and registrar.m)
xamarin/runtime.h xamarin/trampolines.h xamarin/main.h xamarin/xamarin.h