Skip to content

Conversation

thetruestblue
Copy link

@thetruestblue thetruestblue commented Sep 14, 2025

Author: Dan Blackwell [email protected]
Date: Fri Aug 1 16:33:23 2025 +0100

[TSan] Fix asan_mac.cpp function pointer cast warnings (llvm#151517)

Fixes these compiler warnings:

    .../llvm-project/compiler-rt/lib/asan/asan_mac.cpp:252:4: warning: cast from 'dispatch_function_t' (aka 'void (*)(void *)') to 'void (*)(void *, size_t)' (aka 'void (*)(void *, unsigned long)') converts to incompatible function type [-Wcast-function-type-mismatch]
      252 |   ((void (*)(void *, size_t))asan_ctxt->func)(asan_ctxt->block, iteration);
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    .../llvm-project/compiler-rt/lib/asan/asan_mac.cpp:259:32: warning: cast from 'void (*)(void *, size_t)' (aka 'void (*)(void *, unsigned long)') to 'dispatch_function_t' (aka 'void (*)(void *)') converts to incompatible function type [-Wcast-function-type-mismatch]
      259 |       alloc_asan_context(ctxt, (dispatch_function_t)work, &stack);
          |                                ^~~~~~~~~~~~~~~~~~~~~~~~~
    

(cherry picked from commit e7e7494)

[ASan][Darwin][GCD] Add interceptor for dispatch_apply (llvm#149238)

ASan had a gap in coverage for wqthreads blocks submitted by dispatch_apply

This adds interceptor for dispatch_apply and dispatch_apply_f and adds a test that a failure in a dispatch apply block contains thread and stack info.

rdar://139660648
(cherry picked from commit 5ce04b4)

thetruestblue and others added 2 commits September 14, 2025 07:07
ASan had a gap in coverage for wqthreads blocks submitted by
dispatch_apply

This adds interceptor for dispatch_apply and dispatch_apply_f and adds a
test that a failure in a dispatch apply block contains thread and stack
info.

rdar://139660648
(cherry picked from commit 5ce04b4)
Fixes these compiler warnings:
```
.../llvm-project/compiler-rt/lib/asan/asan_mac.cpp:252:4: warning: cast from 'dispatch_function_t' (aka 'void (*)(void *)') to 'void (*)(void *, size_t)' (aka 'void (*)(void *, unsigned long)') converts to incompatible function type [-Wcast-function-type-mismatch]
  252 |   ((void (*)(void *, size_t))asan_ctxt->func)(asan_ctxt->block, iteration);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../llvm-project/compiler-rt/lib/asan/asan_mac.cpp:259:32: warning: cast from 'void (*)(void *, size_t)' (aka 'void (*)(void *, unsigned long)') to 'dispatch_function_t' (aka 'void (*)(void *)') converts to incompatible function type [-Wcast-function-type-mismatch]
  259 |       alloc_asan_context(ctxt, (dispatch_function_t)work, &stack);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~
```

(cherry picked from commit e7e7494)
@thetruestblue thetruestblue merged commit 21179c7 into stable/21.x Sep 14, 2025
@thetruestblue thetruestblue deleted the add_dispatch_apply branch September 14, 2025 14:14
@AnthonyLatsis
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants