-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[rtsan] Error while building rtsan_interceptors.cpp
#100754
Comments
@davidtrevelyan , @cjappl , could you take a look at this, please? |
Pretty sure that this failure is due to fortify source overloads in new glibc, not rtsan changes. (I left a message on slack about this yesterday.) |
Yes, thanks for pinging. Do let us know if you need intervention or testing from us, we are happy to help. |
This is also preventing 19.1.0-rc1 from building now. |
Can someone point me in the right direction of how to build locally with fortified glibc? This is my first time encountering it. For the 19.0 branch, I can recommend a band-aid fix. Because the full v1 of rtsan is unlikely to land in this version, we can simply jettison this interceptor for now and fix this problem before the v20 branch is cut. I am away from my computer for the next couple days, but this patch should do it.
Any advice anyone has in terms of how we can build or fix this more holistically would be great. |
I'll test that and make a PR. Thanks! That said, I'm wondering if it wouldn't be cleaner to revert all the RTSAN commits from 19.x. It looks like a last minute addition that really shouldn't have been done prior to the branching. |
…ource builds Remove the openat interceptor from the 19.x branch, as it currently breaks builds against fortify-sources glibc, and full rtsan will not be included in this version anyway. Patch provided by Chris Apple in llvm#100754 (comment) Bug llvm#100754
Just adding
Adding an explicit cast to the expected function pointer type before casting to the intptr type should work, which avoids the overload ambiguity. By the way, aren't these interceptors (for both open and openat) pretty broken? They seem to assume that the variadic mode argument is always passed, even though it will only be passed for some values of oflag. |
I think that is completely fine as well! Whatever you think is best to unblock 19 :). I think it is likely all the pieces will be put together for 20, as the next major PRs are in flight Again, thanks for the patience with us. We are new to the project and still learning all the dos/donts. Sincerely appreciate the guidance and help! |
Thanks for this guidance, super helpful! I'll go back and make sure the interceptors work as intended with all values. If we don't have unit tests for those cases (with va_args and without) I'll ensure the are added. |
I've put up a possible fix at #100986. |
Since glibc 2.40 some functions like openat make use of overloads when built with `-D_FORTIFY_SOURCE=2`, see: https://github.com/bminor/glibc/blob/master/io/bits/fcntl2.h This means that doing something like `(uintptr_t) openat` or `(void *) openat` is now ambiguous, breaking the compiler-rt build on new glibc versions. Fix this by explicitly casting the symbol to the expected function type before casting it to an intptr. The expected type is obtained as `decltype(REAL(func))` so we don't have to repeat the signature from INTERCEPTOR in the INTERCEPT_FUNTION macro. Fixes llvm#100754. (cherry picked from commit 155b7a1)
Since glibc 2.40 some functions like openat make use of overloads when built with `-D_FORTIFY_SOURCE=2`, see: https://github.com/bminor/glibc/blob/master/io/bits/fcntl2.h This means that doing something like `(uintptr_t) openat` or `(void *) openat` is now ambiguous, breaking the compiler-rt build on new glibc versions. Fix this by explicitly casting the symbol to the expected function type before casting it to an intptr. The expected type is obtained as `decltype(REAL(func))` so we don't have to repeat the signature from INTERCEPTOR in the INTERCEPT_FUNTION macro. Fixes llvm#100754. (cherry picked from commit 155b7a1)
Since glibc 2.40 some functions like openat make use of overloads when built with `-D_FORTIFY_SOURCE=2`, see: https://github.com/bminor/glibc/blob/master/io/bits/fcntl2.h This means that doing something like `(uintptr_t) openat` or `(void *) openat` is now ambiguous, breaking the compiler-rt build on new glibc versions. Fix this by explicitly casting the symbol to the expected function type before casting it to an intptr. The expected type is obtained as `decltype(REAL(func))` so we don't have to repeat the signature from INTERCEPTOR in the INTERCEPT_FUNTION macro. Fixes llvm#100754.
We've been seeing this issue since 2024-07-23.
That makes me believe this started to happen after b177ac4 .
Error message:
The full build log is available at: builder-live.log.gz
The text was updated successfully, but these errors were encountered: