看起来它已连接到此 tsan 提交
https://github.com/llvm/llvm-project/commit/f9a706a36ae5dcb87b0b6649d0c80e989400f48e
https://reviews.llvm.org/D71559
我需要非常糟糕地运行线程清理程序,所以构建了最新的 llvm
> mkdir workspace/
> git clone https://github.com/llvm/llvm-project.git
> cd llvm-project; mkdir build; cd build
>cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;libcxx;libcxxabi;libunwind;lldb;compiler-rt;lld;polly' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$HOME/llvm -DLLVM_ENABLE_DUMP=ON # not everything is needed though here
>ninja
并更换
~/Library/Developer/CoreSimulator/Devices/C0E36E0C-C22A-426E-80B7-557164B2FBD3/data/Containers/Bundle/Application/D6D4D9DB-4C26-4FA0-8363-5CA03A47B6C0/Spotify.app/Frameworks/libclang_rt.tsan_iossim_dynamic.dylib
使用新构建的库
/workspace/llvm-project/build/lib/clang/10.0.0/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib # 10.0.0 is the previos version some artifact of my bulding, it had the fixed revision ^
该应用程序似乎已加载到模拟器中并且不会崩溃
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00007fff523d5bea __abort_with_payload + 10
1 libsystem_kernel.dylib 0x00007fff523d74f3 abort_with_payload_wrapper_internal + 80
2 libsystem_kernel.dylib 0x00007fff523d74a3 abort_with_reason + 19
3 libsystem_pthread.dylib 0x00007fff52469974 pthread_self.cold.1 + 24
4 libsystem_pthread.dylib 0x00007fff52462fe3 pthread_self + 34
5 libclang_rt.tsan_iossim_dynamic.dylib 0x000000013b59816b __tsan::cur_thread() + 11
6 libclang_rt.tsan_iossim_dynamic.dylib 0x000000013b56d985 wrap_sysctlbyname + 37
7 libsystem_sim_kernel.dylib 0x00007fff52470331 assert_simulator_supported_host + 44
8 libSystem.B.dylib 0x00007fff4ff167c1 libSystem_initializer + 78
9 dyld_sim 0x000000013b3a73a7 ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 517
没有了!我的应用程序似乎显示了第一个屏幕,但之后冻结,所以不确定它是否完全可用。
希望有帮助