<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75401>75401</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
ThreadPoolExecutor/libsystem_pthread.dylib-related unit test crashes on ARM macOS Big Sur
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
danpetry
</td>
</tr>
</table>
<pre>
I'm seeing crashes in the following unit tests, with the following stack traces, on macOS Big Sur, but not Ventura. MacOSX11.1 SDK and clang 14.0.6 was used to compile:
```
INFO [ RUN ] ConcurrentHashTableTest.AddStringMultiplueEntriesWithResize
INFO #0 0x0000000104e6c994 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x144994)
INFO #1 0x0000000104e6abf0 llvm::sys::RunSignalHandlers() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x142bf0)
INFO #2 0x0000000104e6d084 SignalHandler(int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x145084)
INFO #3 0x000000019e8cec44 (/usr/lib/system/libsystem_platform.dylib+0x180336c44)
INFO #4 0x000000010426cfbc std::__1::__function::__func<(anonymous namespace)::ConcurrentHashTableTest_AddStringMultiplueEntriesWithResize_Test::TestBody()::$_2, std::__1::allocator<(anonymous
namespace)::ConcurrentHashTableTest_AddStringMultiplueEntriesWithResize_Test::TestBody()::$_2>, void ()>::operator()() (/private$SRC_DIR/build/unittests/ADT/./ADTTests+0x10020cfbc)
INFO #5 0x0000000104decf08 std::__1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0,
std::__1::allocator<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0>, void ()>::operator()() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc4f08)
INFO #6 0x0000000104debebc llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3ebc)
INFO #7 0x0000000104debc10 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >,
llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()> >(void*) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3c10)
INFO #8 0x000000019e883878 (/usr/lib/system/libsystem_pthread.dylib+0x1802eb878)
INFO #9 0x000000019e87e5e0 (/usr/lib/system/libsystem_pthread.dylib+0x1802e65e0)
```
```
INFO [ RUN ] ConcurrentHashTableTest.AddStringEntries
INFO #0 0x0000000105ce0994 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x144994)
INFO #1 0x0000000105cdebf0 llvm::sys::RunSignalHandlers() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x142bf0)
INFO #2 0x0000000105ce1084 SignalHandler(int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x145084)
INFO #3 0x000000019e8cec44 (/usr/lib/system/libsystem_platform.dylib+0x180336c44)
INFO #4 0x0000000104ffecdc llvm::ConcurrentHashTableByPtr<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, (anonymous namespace)::String,
llvm::parallel::PerThreadAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul> >, llvm::ConcurrentHashTableInfoByPtr<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >, (anonymous namespace)::String, llvm::parallel::PerThreadAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul,
4096ul, 128ul> > > >::insert(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (/private$SRC_DIR/build/unittests/ADT/./ADTTests+0x10020acdc)
INFO #5 0x0000000104ffdb4c std::__1::__function::__func<(anonymous namespace)::ConcurrentHashTableTest_AddStringEntries_Test::TestBody()::$_0, std::__1::allocator<(anonymous
namespace)::ConcurrentHashTableTest_AddStringEntries_Test::TestBody()::$_0>, void ()>::operator()() (/private$SRC_DIR/build/unittests/ADT/./ADTTests+0x100209b4c)
INFO #6 0x0000000105c60f08 std::__1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0,
std::__1::allocator<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0>, void ()>::operator()() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc4f08)
INFO #7 0x0000000105c5febc llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3ebc)
INFO #8 0x0000000105c5ff84 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >,
llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()> >(void*)
(/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3f84)
INFO #9 0x000000019e883878 (/usr/lib/system/libsystem_pthread.dylib+0x1802eb878)
INFO #10 0x000000019e87e5e0 (/usr/lib/system/libsystem_pthread.dylib+0x1802e65e0)
```
```
INFO [ RUN ] PerThreadBumpPtrAllocatorTest.Simple
INFO #0 0x0000000103c04994 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x144994)
INFO #1 0x0000000103c02bf0 llvm::sys::RunSignalHandlers() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x142bf0)
INFO #2 0x0000000103c05084 SignalHandler(int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x145084)
INFO #3 0x000000019e8cec44 (/usr/lib/system/libsystem_platform.dylib+0x180336c44)
INFO #4 0x0000000102d03d28 std::__1::__function::__func<(anonymous namespace)::PerThreadBumpPtrAllocatorTest_Simple_Test::TestBody()::$_0, std::__1::allocator<(anonymous
namespace)::PerThreadBumpPtrAllocatorTest_Simple_Test::TestBody()::$_0>, void ()>::operator()() (/private$SRC_DIR/build/unittests/Support/./SupportTests+0x10027fd28)
INFO #5 0x0000000103b84f08 std::__1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0,
std::__1::allocator<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0>, void ()>::operator()() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc4f08)
INFO #6 0x0000000103b83ebc llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3ebc)
INFO #7 0x0000000103b83f84 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >,
llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()> >(void*)
(/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3f84)
INFO #8 0x000000019e883878 (/usr/lib/system/libsystem_pthread.dylib+0x1802eb878)
INFO #9 0x000000019e87e5e0 (/usr/lib/system/libsystem_pthread.dylib+0x1802e65e0)
```
```
INFO [ RUN ] PerThreadBumpPtrAllocatorTest.ParallelAllocation
INFO #0 0x00000001018f4994 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x144994)
INFO #1 0x00000001018f2bf0 llvm::sys::RunSignalHandlers() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x142bf0)
INFO #2 0x00000001018f5084 SignalHandler(int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0x145084)
INFO #3 0x000000019e8cec44 (/usr/lib/system/libsystem_platform.dylib+0x180336c44)
INFO #4 0x0000000100b24cf4 void llvm::function_ref<void (unsigned long)>::callback_fn<(anonymous namespace)::PerThreadBumpPtrAllocatorTest_ParallelAllocation_Test::TestBody()::$_1>(long,
unsigned long) (/private$SRC_DIR/build/unittests/Support/./SupportTests+0x100280cf4)
INFO #5 0x0000000101875198 std::__1::__function::__func<llvm::parallelFor(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>)::$_2,
std::__1::allocator<llvm::parallelFor(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>)::$_2>, void ()>::operator()()
(/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc5198)
INFO #6 0x0000000101874f08 std::__1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0,
std::__1::allocator<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>, bool)::$_0>, void ()>::operator()() (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc4f08)
INFO #7 0x0000000101873ebc llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3ebc)
INFO #8 0x0000000101873c10 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >,
llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()> >(void*) (/private$SRC_DIR/build/lib/libLLVM-17.dylib+0xc3c10)
INFO #9 0x000000019e883878 (/usr/lib/system/libsystem_pthread.dylib+0x1802eb878)
INFO #10 0x000000019e87e5e0 (/usr/lib/system/libsystem_pthread.dylib+0x1802e65e0)
```
Is this a platform issue, or a bug? Please let me know if you need any further info.
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