-
Notifications
You must be signed in to change notification settings - Fork 524
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
abseil-cpp
compilation creates ABI compatibility issues between abseil-cpp
and dependent packages
#10038
Labels
bug
Something isn't working
Comments
surfacepatterns
changed the title
Aug 6, 2024
abseil-cpp
compilation creaetes ABI compatibility issues between abseil-cpp
and dependent packagesabseil-cpp
compilation creates ABI compatibility issues between abseil-cpp
and dependent packages
I've attached code that reproduces the crash to this issue. You can compile the program using:
Running the compiled program using
|
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The current
abseil-cpp
package is built withCMAKE_BUILD_TYPE
set toNone
. This results in the package being built withoutNDEBUG
being defined. This creates ABI incompatibilities betweenabseil-cpp
and packages that depend onabseil-cpp
that are compiled withNDEBUG
defined.I came across this issue when I was running tests for a custom
grpc
based service against Azure Linux. Each time I would run tests, the test executable would end up crashing withgdb
tracebacks similar to this (sans traceback entries into proprietary code):This happened because the implementation of
absl::Mutex
is changed by the presence of anNDEBUG
definition. Whenabseil-cpp
is compiled withoutNDEBUG
, this definition ofabsl::Mutex::Dtor()
is defined in the shared library and meant to be called by theabsl::Mutex
destructor. This helps clear out deadlock info whenNDEBUG
isn't defined. However, whenNDEBUG
is defined by dependent packages, this definition ofabsl::Mutex::Dtor()
is inlined in the dependent binary for use by the dependent package, resulting in the former definition being unused, and causinggrpc
and other dependent packages to abort sporadically (but often) atabsl::Mutex
entry points.One of the prominent maintainers of
abseil-cpp
has mentioned this issue previously.This pull request fixes the problem.
To Reproduce
Steps to reproduce the behavior:
abseil-cpp
, preferably something that creates and destroysabsl::Mutex
instances, and make sure to defineNDEBUG
when compiling.(If the above doesn't illustrate the problem well enough, then I'll attempt to supply a minimal reproduction of the bug when I get a chance.)
Expected behavior
I expect applications that link to
abseil-cpp
to run without crashing.The text was updated successfully, but these errors were encountered: