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

silkworm_capi_test crashes in debug gcc #2447

Open
battlmonstr opened this issue Oct 24, 2024 · 0 comments
Open

silkworm_capi_test crashes in debug gcc #2447

battlmonstr opened this issue Oct 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@battlmonstr
Copy link
Contributor

commit: 7192076
gcc 13.2.0
os: Ubuntu 24.04

configure:

cmake -DCMAKE_BUILD_TYPE=Debug -S . -B build
cmake --build build -j4 -t silkworm_capi_test

test:

$ ./build/silkworm/capi/silkworm_capi_test --help
[libprotobuf ERROR /home/conan/workspace/prod-v1/bsr/71556/bafac/.conan/data/protobuf/3.21.12/_/_/build/2dbf65f76c0469903ce48756c39d50cd4e721678/src/src/google/protobuf/descriptor_database.cc:642] File already exists in database: types/types.proto
[libprotobuf FATAL /home/conan/workspace/prod-v1/bsr/71556/bafac/.conan/data/protobuf/3.21.12/_/_/build/2dbf65f76c0469903ce48756c39d50cd4e721678/src/src/google/protobuf/descriptor.cc:1986] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
Aborted (core dumped)

Preliminary investigation

When interfaces generates code from types/types.proto and others it generates some static variables in types.pb.cc files that trigger an update of this global registry static variable. It is important therefore that silkworm_interfaces and is only linked once in the final binary. Otherwise we have duplicate registrations and a crash. Is it possible that silkworm_interfaces is linked multiple times?

Note: it doesn't happen in clang, and not happening on gcc release and relwithdebinfo, only gcc debug.
We don't see this issue on the linux-gcc-thread-sanitizer job (uses gcc 14 debug), because it defines SILKWORM_SANITIZE, and we disable the silkworm_capi_test target (NO_TEST)

Related bugs

#1881
#2108

@battlmonstr battlmonstr added the bug Something isn't working label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@battlmonstr and others