How to resolve hardened runtime crashes on Mojave?

GRVGRV Member ✭✭

We're seeing a crash every time we start a hardened runtime RELEASE app on Mojave - reduced this to just an empty window by creating a new Cocoa project & even that crashes - any ideas?

Thanks

VS 8.2.3, xcode 10.3, Mojave 10.14.4 - crash report:-

Process: junk999 [1686]
Path: /Users/USER/*/junk999.app/Contents/MacOS/junk999
Identifier: com.thomasfindlay.junk999
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: junk999 [1686]
User ID: 501

Date/Time: 2019-08-19 11:32:28.699 +0100
OS Version: Mac OS X 10.14.4 (18E2034)
Report Version: 12
Anonymous UUID: 62E314D5-0D1F-BCC3-D644-47683302320E

Sleep/Wake UUID: 4929CFC7-BBAA-441C-8EC3-DAC67D3F3615

Time Awake Since Boot: 7100 seconds
Time Since Wake: 1900 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [1686]

VM Regions Near 0:
-->
__TEXT 000000010c651000-000000010cb3e000 [ 5044K] r-x/rwx SM=COW /Users/USER/*/junk999.app/Contents/MacOS/junk999

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.thomasfindlay.junk999 0x000000010c79392a mono_arch_create_sdb_trampoline + 122 (tramp-amd64.c:855)
1 com.thomasfindlay.junk999 0x000000010c77b9dc mini_get_breakpoint_trampoline + 60 (mini-trampolines.c:1691)
2 com.thomasfindlay.junk999 0x000000010c737f24 mono_arch_init + 196 (mini-amd64.c:1409)
3 com.thomasfindlay.junk999 0x000000010c774bd2 mini_init + 882 (mini-runtime.c:4263)
4 com.thomasfindlay.junk999 0x000000010c6d67ec mono_main + 5980 (driver.g.c:2512)
5 com.thomasfindlay.junk999 0x000000010c68b4a8 xamarin_main + 1192 (launcher.m:663)
6 com.thomasfindlay.junk999 0x000000010c68c354 main + 36 (launcher.m:681)
7 libdyld.dylib 0x00007fff648913d5 start + 1

Thread 1:
0 libsystem_pthread.dylib 0x00007fff64a7e3f0 start_wqthread + 0

Thread 2:
0 libsystem_pthread.dylib 0x00007fff64a7e3f0 start_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000600000e980b0 rbx: 0x0000600000e980b0 rcx: 0x0000600000e980b0 rdx: 0x0000000000000000
rdi: 0x0000600000e980c0 rsi: 0x0000000000000000 rbp: 0x00007ffee35ae200 rsp: 0x00007ffee35ae1c0
r8: 0x0000ece4d52e80c0 r9: 0x000000010cba1c58 r10: 0x0000000000000000 r11: 0x000000010cba1c50
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x000000010c79392a rfl: 0x0000000000010246 cr2: 0x0000000000000000

Logical CPU: 0
Error Code: 0x00000006
Trap Number: 14

Best Answers

  • GRVGRV ✭✭
    Accepted Answer

    Thanks John - same crash on my setup!

    If this all works for you then I'm encouraged - I'll set up a clean VMware Mojave build with VStudio & xcode & hopefully that works.

  • GRVGRV ✭✭
    Accepted Answer

    Oops - Xamarin documents didn't make it clear I have to type "Entitlements.plist" in t he cutom entiotlements box

Answers

  • JohnConnersJohnConners GBMember ✭✭

    Have you followed the steps here?

    https://devblogs.microsoft.com/xamarin/macos-hardened-runtime-notary/

    Of particular interest are the new entitlements. For my app I had to use com.apple.security.cs.allow-dyld-environment-variables to make it work with SQLite, but aside from that I didn't have any problems on the latest version of everything.

  • GRVGRV Member ✭✭

    Thanks John
    Yes we checked that out & we set just the JIT compile entitlement and in our test case it's just a stub, empty project so we didn't need any other entitlements.
    Weird -it couldn't be a simpler setup & it goes bang every time with the crash report I posted

  • JohnConnersJohnConners GBMember ✭✭

    So attached is a project I've just created on the latest version of everything (i.e. VS, Xamarin.Mac, etc) that, when I do a release build, is hardened. Didn't seem to have any problem on my machine (I'm running macOS 10.14.6). What happens when you build and run a release build of that?

  • GRVGRV Member ✭✭
    Accepted Answer

    Thanks John - same crash on my setup!

    If this all works for you then I'm encouraged - I'll set up a clean VMware Mojave build with VStudio & xcode & hopefully that works.

  • GRVGRV Member ✭✭
    Accepted Answer

    Oops - Xamarin documents didn't make it clear I have to type "Entitlements.plist" in t he cutom entiotlements box

Sign In or Register to comment.