-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
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
Clang RealtimeSanitizer support #76
Comments
Hi, this is very interesting. Do you want to work on a PR? |
Maybe this can go in |
@abique I just got confirmation that RtSan does actually work with function pointers too. realtime-sanitizer/rtsan#42 This is great news since it will allow us to use it in the CLAP API rather than just these clap-helpers.
It hasn't actually been released yet, but it will be available in Clang 20 which should release in March.
Sure, I will work on a PR once I get the chance. |
It's good to have the PR ready, so we can checkout the branch and test. |
The discussion in free-audio/clap#448 gave me the idea of marking real-time functions with a macro, say
CLAP_REALTIME
, rather than marking them as real-time in a comment.By default,
CLAP_REALTIME
would be empty and do nothing (besides being documentation), but when compiled with Clang's new RealtimeSanitizer enabled in C or C++, it could provide runtime checking of CLAP API functions marked as real-time:At least that's what I hoped we could do, but unfortunately it appears unlikely thatI was wrong, it actually is possible to use on function pointers.[[clang::nonblocking]]
can be applied to function pointers like those the CLAP API uses, though I haven't confirmed this yet.Fortunately it should be possible to apply the RealtimeSanitizer here since this library uses regular functions instead of function pointers.
clap-helpers is probably more fitting for this sort of thing anyway given the focus on enforcing correctness through the use of checking levels and misbehavior handlers.Putting them in the CLAP API will allow C23 programs to benefit from RtSan too.Does this sound like a good idea?
The text was updated successfully, but these errors were encountered: