You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of gRPC and what language are you using?
gRPC C++ v1.45.2
Bug exists currently in master branch as well.
What operating system (Linux, Windows,...) and version?
Linux Fedora 40
What runtime / compiler are you using (e.g. python version or version of gcc)
Clang version 18.1.6 (Fedora 18.1.6-3.fc40)
What did you do?
Passed a global instance of GlobalCallbacks into grpc::Server::SetGlobalCallbacks.
What did you expect to see?
I expected that the global instance of the GlobalCallbacks wouldn't have its deconstructed called twice.
What did you see instead?
Application segfault as we created a derived class from the GlobalCallbacks and the deconstructor alerted of a double deconstruction.
Issue is that the documentation and the implementation don't match. Documentation states (see here):
/// Set the global callback object. Can only be called once per application./// Does not take ownership of callbacks, and expects the pointed to object/// to be alive until all server objects in the process have been destroyed./// The same \a GlobalCallbacks object will be used throughout the/// application and is shared among all \a Server objects.staticvoidSetGlobalCallbacks(GlobalCallbacks* callbacks);
Issue is that it states that it "Does not take ownership of callbacks", however in the implementation (see here) it does indeed take ownership of the objects lifetime, which is why during deconstruction I noticed this double free behavior.
Simple fix is to remove the std::shared_ptr usage here.
Anything else we should know about your project / environment?
No.
The text was updated successfully, but these errors were encountered:
What version of gRPC and what language are you using?
gRPC C++ v1.45.2
Bug exists currently in
master
branch as well.What operating system (Linux, Windows,...) and version?
Linux Fedora 40
What runtime / compiler are you using (e.g. python version or version of gcc)
Clang version 18.1.6 (Fedora 18.1.6-3.fc40)
What did you do?
Passed a global instance of
GlobalCallbacks
intogrpc::Server::SetGlobalCallbacks
.What did you expect to see?
I expected that the global instance of the
GlobalCallbacks
wouldn't have its deconstructed called twice.What did you see instead?
Application segfault as we created a derived class from the
GlobalCallbacks
and the deconstructor alerted of a double deconstruction.Issue is that the documentation and the implementation don't match. Documentation states (see here):
Issue is that it states that it "Does not take ownership of callbacks", however in the implementation (see here) it does indeed take ownership of the objects lifetime, which is why during deconstruction I noticed this double free behavior.
Simple fix is to remove the
std::shared_ptr
usage here.Anything else we should know about your project / environment?
No.
The text was updated successfully, but these errors were encountered: