Skip to content
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

Open
nextsilicon-itay-bookstein opened this issue Jul 10, 2024 · 4 comments

Comments

@nextsilicon-itay-bookstein

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 to ABSL_HAVE_ADDRESS_SANITIZER or ABSL_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 to 20230125.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

@ediap
Copy link

ediap commented Sep 27, 2024

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.
Basically, in our case, we need to use legal-approved pre-compiled versions of external libraries (company policy). Abseil is one of them. When using an ASAN build (GCC 13) of our tools linked to a non-asan build of Abseil we encounter the following crashes from absl::flat_hash_map (name of libraries obfuscated):
SIGSEGV caught. zzzz.so.8(+0x7b2e1)[0x2b61488972e1] xxxx.so(_Z13signalHandleri+0x329)[0x2b614bbd4da6] /lib64/libpthread.so.0(+0xf630)[0x2b6176766630] yyyy.exe(ZN4absl12lts_2024011618container_internal19HashSetResizeHelper15InitializeSlotsISaIcELm40ELb0ELm8EEEbRNS1_12CommonFieldsEPvT+0x140)[0x9b78cc] yyyy.so(ZN4absl12lts_2024011618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16lib_model_structEENS1_10StringHashENS1_8StringEqESaISt4pairIKS9_SB_EEE6resizeEm+0x1cb)[0x2b6162e20a2d] yyyy.so(ZN4absl12lts_2024011618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16lib_model_structEENS1_10StringHashENS1_8StringEqESaISt4pairIKS9_SB_EEE14prepare_insertEm+0x110)[0x2b6162e20ff4] yyyy.so(ZN4absl12lts_2024011618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16lib_model_structEENS1_10StringHashENS1_8StringEqESaISt4pairIKS9_SB_EEE22find_or_prepare_insertIPKcEESF_ImbERKT+0x8d2)[0x2b6162e24454] yyyy.so(ZNK4absl12lts_2024011618container_internal12raw_hash_setINS1_17FlatHashMapPolicyINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16lib_model_structEENS1_10StringHashENS1_8StringEqESaISt4pairIKS9_SB_EEE19EmplaceDecomposableclIPKcJRKSt21piecewise_construct_tSt5tupleIJOSN_EESR_IJOSB_EEEEESF_INSJ_8iteratorEbERKT_DpOT0+0xe0)[0x2b6162e26170] yyyy.so(ZN4absl12lts_2024011618container_internal15memory_internal17DecomposePairImplINS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16lib_model_structEENS1_10StringHashENS1_8StringEqESaISt4pairIKSB_SD_EEE19EmplaceDecomposableEOPKcSt5tupleIJOSD_EEEEDTclcl7declvalIT_EEcl7declvalIRKT0_EEL_ZSt19piecewise_constructEcl7declvalISQ_IJSU_EEEEcl7declvalIT1_EEEEOST_SH_ISX_SY_E+0x32)[0x2b6162e263ed] yyyy.so(ZN4absl12lts_2024011618container_internal13DecomposePairINS1_12raw_hash_setINS1_17FlatHashMapPolicyINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16lib_model_structEENS1_10StringHashENS1_8StringEqESaISt4pairIKSA_SC_EEE19EmplaceDecomposableEJSG_IPKcSC_EEEEDTcl17DecomposePairImplcl7forwardIT_Efp_Ecl8PairArgsspcl7forwardIT0_Efp0_EEEEOSP_DpOSQ+0xa5)[0x2b6162e264a3] ...
Is there any recommended solution/workaround for the above issue, so we can still test our code using absl::flat_hash_map with AddressSanitizer?

@mg-jump
Copy link

mg-jump commented Dec 18, 2024

+1 also have the issue.
gcc 13 being used asan on. build the repo without asan. Then build my repo with asan linking against absl
code

#include <absl/container/flat_hash_map.h>

int main() {
    absl::flat_hash_map<std::string, std::string> mappy;
    mappy.insert({"a", "b"});
    return 0;
}

cmake:

add_executable(absl_test absl_test.cpp)
target_link_libraries(absl_test PRIVATE absl::flat_hash_map)
$ ./build/asan/absl_test
AddressSanitizer:DEADLYSIGNAL
=================================================================
==112595==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000423997 bp 0x7fffffffc2e0 sp 0x7fffffffc238 T0)
==112595==The signal is caused by a READ memory access.
==112595==Hint: address points to the zero page.
    #0 0x423997 in absl::lts_20230125::container_internal::FindInfo absl::lts_20230125::container_internal::find_first_non_full<void>(absl::lts_20230125::container_internal::CommonFields const&, unsigned long) (/home/user/archer/build/asan/absl_test+0x423997)
    #1 0x41cfe0 in absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::prepare_insert(unsigned long) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/raw_hash_set.h:2477
    #2 0x41b998 in std::pair<unsigned long, bool> absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::find_or_prepare_insert<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/raw_hash_set.h:2462
    #3 0x41aae2 in std::pair<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::iterator, bool> absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable::operator()<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&>, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&>&&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&>&&) const /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/raw_hash_set.h:2262
    #4 0x41a490 in decltype (((declval<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable>)())((declval<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&& const&>)(), std::piecewise_construct, (declval<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&> >)(), (declval<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&> >)())) absl::lts_20230125::container_internal::memory_internal::DecomposePairImpl<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&> >(absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable&&, std::pair<std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&>, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&> >) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/container_memory.h:140
    #5 0x419de8 in decltype (DecomposePairImpl((forward<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable>)({parm#1}), PairArgs((forward<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)({parm#2})))) absl::lts_20230125::container_internal::DecomposePair<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable&&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&&) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/container_memory.h:207
    #6 0x419825 in decltype (DecomposePair((declval<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable>)(), (declval<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)())) absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::apply<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable&&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&&) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/flat_hash_map.h:587
    #7 0x41932a in decltype (absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::apply((forward<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable>)({parm#1}), (forward<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)({parm#2}))) absl::lts_20230125::container_internal::hash_policy_traits<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, void>::apply<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::EmplaceDecomposable&&, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&&) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/hash_policy_traits.h:134
    #8 0x4182d3 in std::pair<absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::iterator, bool> absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::emplace<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, 0>(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&&) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/raw_hash_set.h:1886
    #9 0x416a3f in absl::lts_20230125::container_internal::raw_hash_set<absl::lts_20230125::container_internal::FlatHashMapPolicy<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, absl::lts_20230125::container_internal::StringHash, absl::lts_20230125::container_internal::StringEq, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::insert(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&&) /home/modules/rhel8/absl-20230125.3-cxx20-gcc13-static/include/absl/container/internal/raw_hash_set.h:1814
    #10 0x4113bf in main /home/user/repo/absl_test.cpp:5
    ```

@mg-jump
Copy link

mg-jump commented Dec 18, 2024

A work around

#ifdef __SANITIZE_ADDRESS__
#define ORIGINAL_SANITIZE_ADDRESS __SANITIZE_ADDRESS__
#undef __SANITIZE_ADDRESS__
#endif

#include <absl/base/config.h>

#ifdef ORIGINAL_SANITIZE_ADDRESS
#undef __SANITIZE_ADDRESS__
#define __SANITIZE_ADDRESS__ ORIGINAL_SANITIZE_ADDRESS
#undef ORIGINAL_SANITIZE_ADDRESS
#endif

before including any absl code. I personally put that into a new header file and called the header file before include absl code.

@ediap
Copy link

ediap commented Dec 23, 2024

I can confirm that the above workaround works.

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

No branches or pull requests

3 participants