-
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]: Sanitizer options may disagree between library and user leading to ODR violations #1708
Comments
We also encountered a similar issue. We have not observed this issue with older version 20211102.0, which we changed to 20240116.2. Bumping version to the latest tagged release does not help. |
+1 also have the issue.
cmake:
|
A work around
before including any absl code. I personally put that into a new header file and called the header file before include absl code. |
I can confirm that the above workaround works. |
Describe the issue
I got an ODR violation stemming from compiling the library without sanitizers and linking against it from code that is compiled with sanitizers enabled. The definition and behavior of some data structures (such as
raw_hash_set
) changes according toABSL_HAVE_ADDRESS_SANITIZER
orABSL_HAVE_MEMORY_SANITIZER
, and these detect the sanitizer state in the translation unit into which they're included, so ODR violations ensue.I think perhaps the sanitizer state of the library needs to be "frozen" at build time and propagated as build flags to consumers a-la pkg-config, rather than relying on it matching between library and user.
Steps to reproduce the problem
Compile the abseil library with sanitizers disabled, link against it from a translation unit in which sanitizers are enabled, try to insert into e.g. an
absl::flat_hash_map
.What version of Abseil are you using?
I tried to upgrade our abseil dependency from
20220623.0
to20230125.3
and ran into the above issue.What operating system and version are you using?
Linux/debian-10
What compiler and version are you using?
clang-16
What build system are you using?
cmake 3.27.9, and I depend on Abseil through Conan.
Additional context
No response
The text was updated successfully, but these errors were encountered: