Skip to content

GOFLAGS="-buildmode=pie" leads to segfaulting executable on 386 #278

@zmedico

Description

@zmedico

This issue was originally reported in https://bugs.gentoo.org/917577, and I was able to reproduce it in the 386 version of the debian:unstable-20231030 docker image, like this:

# Select the 386 version of debian:unstable-20231030 by sha256 hash.
FROM docker.io/library/debian@sha256:fc007e931599ce93e8feb29ce52c5a750e387f195670938c7023716189522a36
RUN apt update && \
	apt install -y golang git make && 
	git clone --depth=1 https://github.com/prometheus/promu.git /tmp/promu && \
	env GOFLAGS="-buildmode=pie" make -C /tmp/promu build && \
	/tmp/promu/promu

The make command exits "successfully" after emitting a message like this:

# github.com/prometheus/promu
loadinternal: cannot find runtime/cgo

The resulting executable segfaults regardless of arguments:

# /tmp/promu/promu 
Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions