-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Bug]: Constexpr expansion compilation error with GCC's UndefinedBehaviorSanitizer #1634
Comments
Same issue here. |
@derekmauro can somebody from abseil look at it please, it blocks our development. We use google quiche that uses abseil, but we build it by gcc with undefined behavior sanitizer and it results into this bug. |
For a temporary workaround, I used clang for sanitizer builds. |
Unfortunately, t's not an option in our environment. |
Sorry, this issue is not a priority for me at the moment. |
Is there any update on this? Is it an abseil issue or a GCC issue? |
|
A bug of gcc yet abseil may need some workaround to avoid considering it is such a fundamental library |
I had to disable sanitizer checks, which is a bad idea, but I'm not sure what else we can do... |
We needed the ubsan in gcc, so I created a patch to fix this issue. If anybody is interested, I am posting it here. The patch is based on the commit 60d1ce9 (current master). It works for the abseil itself, built by cmake and for abseil tests. Abseil benchmarks build is not tested as they are not in cmake scripts, or I didn't find them there. So maybe an "auto" return value will need to be specified in raw_hash_set_probe_benchmark.cc. @derekmauro feel free to use it, modify it or just be inspired by it and integrate it into master if you want to (some kind of fix in the master would make my life easier :) ) |
Describe the issue
When building abseil with GCC with
-fsanitize=undefined
, the following compilation error occurs:This code producing the error has been introduced with commit 4c7e7c7.
The error does not occur when building with no sanitizer or when building with
-fsanitize=address
or-fsanitize=thread
.This seems to be a known GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962
Steps to reproduce the problem
Isolated expression from the method where the error occurs (
absl::container_internal::hash_policy_traits::get_hash_slot_fn<Hash>()
) with-std=gnu++17 -fsanitize=undefined
: https://godbolt.org/z/8bEazf6e5What version of Abseil are you using?
7bd9ff9
What operating system and version are you using?
Ubuntu 20.04.6 LTS
What compiler and version are you using?
GCC 9.4.0
Also tested with GCC 13.2 on linked godbolt.
What build system are you using?
cmake 3.16.3
Additional context
No response
The text was updated successfully, but these errors were encountered: