Static linking of protoc leads to segmentation fault
#15,441 创建于 2024年1月15日
仓库指标
- 星标
- (71,223 个星标)
- PR 合并指标
- (平均合并 2天 11小时) (30 天内合并 185 个 PR)
描述
What version of protobuf and what language are you using? Version: 25.2
What operating system (Linux, Windows, ...) and version? Ubuntu 20.04 (virtual machine and docker)
What runtime / compiler are you using (e.g., python version or gcc version)
gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
What did you do? Steps to reproduce the behavior (Can also execute the commands inside of a virtual machine with Ubuntu 20.04): Dockerfile
FROM ubuntu:20.04
ARG BAZEL_VERSION=6.1.1
ARG PROTOBUF_VERSION=25.2
# install build essentials and wget
RUN apt-get update \
&& apt-get -y install build-essential wget \
&& rm -rf /var/lib/apt/lists/*
# isntall bazel
RUN cd /usr/bin \
&& wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-x86_64 \
&& chmod +x bazel-${BAZEL_VERSION}-linux-x86_64 \
&& ln -s bazel-${BAZEL_VERSION}-linux-x86_64 bazel \
&& cd -
# download protobuf and build protoc_static
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz \
&& tar xf protobuf-${PROTOBUF_VERSION}.tar.gz \
&& cd protobuf-${PROTOBUF_VERSION} \
&& bazel build :protoc_static \
&& ln -s $PWD/bazel-bin/protoc_static /usr/bin/protoc
run:
root@b3f025ec6d0a:/# protoc
Segmentation fault (core dumped)
What did you expect to see I expected to see the help message.
What did you see instead? I got a segmentation fault.
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment Static linking of protoc works on Ubuntu 22.04 (docker and native)