I am building an application using .NET and Avalonia UI. The application is cross-platform. One of the tasks of the application is to coordinate data collection that is then routed into a Docker container for analysis.
Everything works as expected in Windows. Everything works as expected in macOS on the development workstation and before packaging. After I package/codesign into a hardened runtime, I start seeing crashes at the moment when I try to execute the system calls to Docker.
I am reasonably confident that this has something to do with an entitlement flag or some other permissions issue. I have been trying to sort this on my own for a while. I am only hoping someone can nudge me in the right direction.
Thanks, Kevin
Look at the backtrace of the crashing thread here:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x7ff8089fb846 __pthread_kill + 10
1 libsystem_pthread.dylib 0x7ff808a36b16 pthread_kill + 259
2 libsystem_c.dylib 0x7ff80895573e abort + 126
3 libcoreclr.dylib 0x10fb351d9 PROCAbort + 57
4 libcoreclr.dylib 0x10fb350f9 TerminateProcess + 137
5 libcoreclr.dylib 0x10fd45de9 UnwindManagedExceptionPass1(PAL_SEHException&, _CONTEXT*) + 1081
6 libcoreclr.dylib 0x10fd45e2d DispatchManagedException(PAL_SEHException&, bool) + 61
7 libcoreclr.dylib 0x10fcb559d IL_Throw(Object*) + 445
8 ??? 0x11475fdca ???
9 ??? 0x1139f5148 ???
10 ??? 0x1139f4c42 ???
11 ??? 0x1139f4981 ???
12 ??? 0x1139f4633 ???
13 ??? 0x113716f35 ???
14 ??? 0x111942cf3 ???
15 ??? 0x11193194e ???
16 libcoreclr.dylib 0x10fdf7db1 CallDescrWorkerInternal + 124
17 libcoreclr.dylib 0x10fc57e13 MethodDescCallSite::CallTargetWorker(unsigned long long const*, unsi…
18 libcoreclr.dylib 0x10fb51588 RunMain(MethodDesc*, short, int*, PtrArray**) + 712
19 libcoreclr.dylib 0x10fb51992 Assembly::ExecuteMainMethod(PtrArray**, int) + 450
20 libcoreclr.dylib 0x10fb7bd81 CorHost2::ExecuteAssembly(unsigned int, char16_t const*, int, char16…
21 libcoreclr.dylib 0x10fb3eb72 coreclr_execute_assembly + 226
22 libhostpolicy.dylib 0x10f44b57d run_app_for_context(hostpolicy_context_t const&, int, char const**) …
23 libhostpolicy.dylib 0x10f44c4f4 corehost_main + 276
24 libhostfxr.dylib 0x10f36ee55 fx_muxer_t::handle_exec_host_command(std::__1::basic_string, std::__…
25 libhostfxr.dylib 0x10f36df61 fx_muxer_t::execute(std::__1::basic_string, std::__1::allocator>, in…
26 libhostfxr.dylib 0x10f36ac83 hostfxr_main_startupinfo + 131
27 CVRAnalysisToolkit 0x10f2b0b4d exe_start(int, char const**) + 1565
28 CVRAnalysisToolkit 0x10f2b0daf main + 175
29 dyld 0x7ff808691530 start + 3056
Frames 28 through 16 seem to be your language runtime starting up. Frames 15 through 8 seem to be JITed code, because the addresses aren’t in any image listed in the Binary Images
section. Frame 7 suggests that your JITed code threw a language exception, and that leads to frames 6 through 3, which suggest that the language exception went unhandled and thus crashed the process.
It’s hard to offer definitive advice without knowing more about the issue, such as:
- The identity of the code in frames 15 through 8.
- The nature of the exception thrown in frame 7.
I don’t have any hints for the first point. That’s something you’d need to discuss with your tools vendor.
My experience with the second point is that such exceptions are ofter logged to stderr
, which you can see if you manually run the app from Terminal. See my advice on this topic in Resolving Trusted Execution Problems (search that page for Terminal).
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"