protocolbuffers/protobuf

Static linking of protoc leads to segmentation fault

Fechada

#15.441 aberto em 15 de jan. de 2024

 (0 comentário) (0 reação) (0 responsável)C++ (16.128 forks)batch import
c++help wanted

Métricas do repositório

Stars
 (71.223 estrelas)
Métricas de merge de PR
 (Mesclagem média 2d 11h) (185 fundiu PRs em 30d)

Description

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)

Guia do colaborador