We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On macOS 12.x and 13.x on both x86_64 and Arm64 with Xcode this simple code in a toy app:
NSArray* array = @[@1, @2, @3, @4, @5, @6, @7]; dispatch_apply([array count], DISPATCH_APPLY_AUTO, ^(size_t idx) { NSNumber* unused = array[idx]; // TSan says race here?! (void)unused; });
Causes a TSan warning:
WARNING: ThreadSanitizer: data race (pid=33556) Read of size 8 at 0x00010b863380 by thread T6: #0 __45-[AppDelegate applicationDidFinishLaunching:]_block_invoke <null> (TSanTest:arm64+0x100002d4c) #1 __wrap_dispatch_apply_block_invoke <null> (libclang_rt.tsan_osx_dynamic.dylib:arm64+0x7db4c) #2 _dispatch_client_callout2 <null> (libdispatch.dylib:arm64e+0x6a10) Previous write of size 8 at 0x00010b863380 by main thread: #0 __copy_helper_block_e8_32s <null> (TSanTest:arm64+0x100002874) #1 _call_copy_helpers_excp <null> (libsystem_blocks.dylib:arm64e+0x2120) #2 -[AppDelegate applicationDidFinishLaunching:] <null> (TSanTest:arm64+0x100002c9c) #3 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null> (CoreFoundation:arm64e+0x7655c) #4 <null> <null> (0x0001b16b7e50) Location is heap block of size 40 at 0x00010b863360 allocated by main thread: #0 malloc <null> (libclang_rt.tsan_osx_dynamic.dylib:arm64+0x54e90) #1 _Block_copy <null> (libsystem_blocks.dylib:arm64e+0x1b30) #2 -[AppDelegate applicationDidFinishLaunching:] <null> (TSanTest:arm64+0x100002c9c) #3 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ <null> (CoreFoundation:arm64e+0x7655c) #4 <null> <null> (0x0001b16b7e50) Thread T6 (tid=1384939, running) is a GCD worker thread
I'm 99% sure there's no bug in my example code above.
I figure this is either:
(I'd appreciate if anyone knows which.)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
On macOS 12.x and 13.x on both x86_64 and Arm64 with Xcode this simple code in a toy app:
Causes a TSan warning:
I'm 99% sure there's no bug in my example code above.
I figure this is either:
(I'd appreciate if anyone knows which.)
The text was updated successfully, but these errors were encountered: