Open keith-bennett-airmap opened 1 year ago
Note: other (golang) projects in the larger product use protobuf v22.2. I couldn't use that because of build issues.
I've tracked those build issues down to a problem with Address Sanitizer which I normally have turned on for all debug builds. I have created a separate issue for that problem.
However, other than the build issue with Address Sanitizer, v22.4 does not appear to have this stack smashing issue.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive
because the last activity was over 90 days ago.
This stack smashing issue has cropped up, in a private repository, once or twice since last posting here. The most recent workaround seems to be to use the minimal grpc lib instead of the full grpc lib, but I'm not convinced that truly solves the problem since it appears to be related to protobuf itself.
Note that I originally thought this is a bug in the gRPC generator, so I filed an issue here. However, I have since realized that this is an issue in protobuf: I can reproduce the issue without grpc.
What version of protobuf and what language are you using? Version: v21.12 Version: v20.2 Version: v19.5 Version: v18.3 Version: v16.2 Version: v3.10.1 Version: v3.6.1.3
Language: C++
What operating system (Linux, Windows, ...) and version? Ubuntu 20.04 LTS
What runtime / compiler are you using (e.g., python version or gcc version)
gcc --version
->What did you do?
Greeter
service quickstart example fromgrpc.io
found here../src/proto/greeter.proto
import "google/api/field_behavior.proto";
to import a.proto
file fromgoogleapis
repository here.HelloRequest
andHelloReply
in an executable which links against the static libraryThis is verified in a repository I created with a demonstration here.
You can run
./build.sh
. It will:protobuf-toolchain
andprotobuf-stacksmash
images to keep Docker from using tons of resources while iterating changes to the source treeubuntu-2004-toolchain
image which includes only the Ubuntu packages required to compilegcc-11
is installed from ubuntu-toolchain PPAcmake-toolchain
image which builds and installs cmake from sourceprotobuf-toolchain
image which builds and installsprotobuf
from sourceprotobuf
version. Note that I use versionv21.12
due to a separate issue found while constructing this demonstration.grpc
versionprotobuf-stacksmash
image which compiles a demonstrationprotobuf-stacksmash
image to demonstrate whether the resulting executable is viableWhat did you expect to see :heavy_check_mark: Per initial commit here:
./build.sh
->What did you see instead? :exclamation: :stop_sign:
./build.sh
->Anything else we should know about your project / environment
./build.sh
is the driver for the demo../docker
contains Dockerfiles and scripts to set up the build toolchain../docker/ubuntu-2004-toolchain.Dockerfile
installs GCC./docker/cmake-toolchain.Dockerfile
inheritsFROM ubuntu-2004-toolchain
and builds & installs cmake./docker/protobuf-toolchain.Dockerfile
inheritsFROM cmake-toolchain
and builds & installs protobufs (especially protoc). The version of protobuf can be configured as an argument../Dockerfile
inheritsFROM protobuf-toolchain
and builds the project with cmake../src
contains the stack smashing demo./src/proto/external
contains a static library whose only purpose is to compile external proto files -- eg proto files that were nominally downloaded from elsewhere (eg, here../src/proto
contains a static library whose only purpose is to compile proto files into a static library. It contains the greeter service proto. It then links to and imports the external protos../src/greeter-service
contains an executable. Its only purpose is to link against the static proto library and instantiate the objects that were generated.The
./Dockerfile
then sets greeter-service as its entrypoint so thatdocker run
will run the demo.This problem is a Minimal Compilable Reproducible Example that has been trimmed down from a larger codebase. The larger codebase includes several golang projects which are currently using the .proto files being imported. This issue blocks me from building a C++ project to communicate with several golang projects that are already importing this file.