I'm looking at getting Valgrind to run on macOS 10.15 Catalina.
So far I have the build working OK (based on a fork for 10.14 plus a few tweaks specific to 10.15).
However when I run Valgrind [and I'm running the minimal --tool=none with an app that is just "int main(void) {}"] then I'm getting an error related to pthread_init. From what I see from the executed machine code, there is a test for _os_xbs_chrooted (a global variable in the kernel by the looks of it) which then leads to a call to __pthread_init.cold.2. This function contains a ud2 opcode which triggers a SIGILL in the Valgrind VM.
Dearching google for _os_xbs_chrooted doesn't come up with anything much. There's this https://github.com/apple/darwin-libpthread/blob/master/src/pthread.c for the pthread check, and one other reference for the initialization.
I realize this looks like it could be security related and information is not made public.
Any suggestions as to how I can proceed? I have little experience in kernel programming.