-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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]: SIGSEGV from absl::flat_hash_map::insert() #1524
Comments
I think this might be the same issue that I have been observing: when trying to run asan even on the most simple I'm using the following test program: #include <absl/container/flat_hash_map.h>
int main(int argc, char const *argv[]) {
absl::flat_hash_map<int, int> lengths;
// try_emplace fails in the exact same way
lengths[99] = 1;
return 0;
} I build this with the following cmakelists file: cmake_minimum_required(VERSION 3.10)
project(memissue)
set(CMAKE_CXX_STANDARD 17)
add_subdirectory(abseil-cpp) # 20230125.3
add_executable(absl_issue absl_issue.cpp)
target_link_libraries(absl_issue absl::flat_hash_map)
target_compile_options(absl_issue PRIVATE -fsanitize=address)
target_link_options(absl_issue PRIVATE -fsanitize=address) Building and running the executable with both Apple clang 14.0.3.14030022 (XCode 14.3.1) on an Intel MacBook Pro and gcc 11.3.0 on CentOS7 results in the following error (this one is from the Mac):
|
@ricrogz - Your issue is probably stemming from not applying |
We also encountered the same issue:
When |
Describe the issue
We are using
absl::flat_hash_map
in our code base. When ouroperator new
throws an exception at the wrong time inabsl::flat_hash_map::insert()
, the program exits withSIGSEGV
(orSIGABRT
, depending on your malloc implementation). Since abseil gives the basic exception guarantee, this should not happen.Steps to reproduce the problem
Here is a reproduction on
godbolt.org
: https://godbolt.org/z/WaYG7hqjjThis is the minimal reproduction of the problem:
What version of Abseil are you using?
lts_2023_01_25
The godbolt reproduction uses
trunk
.What operating system and version are you using?
Ubuntu 22.04.3 LTS
What compiler and version are you using?
Ubuntu clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
What build system are you using?
CMake or whatever godbolt is using
Additional context
No response
The text was updated successfully, but these errors were encountered: