Skip to content

cmd/go,misc/cgo: problems with PIE builds on alpine builder  #54354

Open
@thanm

Description

@thanm

What version of Go are you using (go version)?

$ go version
go version devel go1.20-13bd6ddbe7 Tue Aug 9 12:18:32 2022 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

linux/amd64 on Alpine

What did you do?

run all.bash

What did you expect to see?

clean run

What did you see instead?

There appear to be several failures on the linux-amd64-alpine builder related to PIE build mode. Details:

--- FAIL: TestBuildmodePIE (0.00s)
    --- FAIL: TestBuildmodePIE/non-cgo (7.49s)
        go_test.go:2199: running testgo [build -buildmode=pie -o /workdir/tmp/cmd-go-test-1325586298/gotest3971771153/main.exe /workdir/tmp/cmd-go-test-1325586298/gotest3971771153/main.go]
        go_test.go:2288: fork/exec /workdir/tmp/cmd-go-test-1325586298/gotest3971771153/main.exe: no such file or directory
go test proxy running at GOPROXY=http://127.0.0.1:41491/mod
FAIL
FAIL	cmd/go	61.246s
...
##### internal linking of -buildmode=pie
fork/exec /workdir/tmp/go-build3110784466/b001/reflect.test: no such file or directory
FAIL	reflect	0.001s
FAIL
2022/08/09 13:27:44 Failed: exit status 1
ok  	os/user	0.005s
...
fork/exec /workdir/tmp/go-build2474382477/b001/nocgo.test: no such file or directory
FAIL	misc/cgo/nocgo	0.000s
FAIL
2022/08/09 13:28:15 Failed: exit status 1
...
##### ../misc/cgo/testshared
--- FAIL: TestTrivialPIE (0.21s)
    shared_test.go:52: executing ./trivial_pie (trivial_pie) failed fork/exec ./trivial_pie: no such file or directory:
FAIL
FAIL	misc/cgo/testshared	54.116s
FAIL
2022/08/09 13:29:16 Failed: exit status 1

This needs to be looked into. I am guessing that it has something to do with the builder configuration.

Activity

added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
on Aug 9, 2022
added this to the Backlog milestone on Aug 9, 2022
gopherbot

gopherbot commented on Aug 9, 2022

@gopherbot
Contributor

Change https://go.dev/cl/422295 mentions this issue: test: skip -buildmode=pie tests on alpine

cherrymui

cherrymui commented on Aug 9, 2022

@cherrymui
Member

The errors

fork/exec /workdir/tmp/cmd-go-test-4042215474/gotest2288649889/main.exe: no such file or directory

look like the dynamic linker path is wrong?

Maybe worth trying to build a PIE binary and looking at the dynamic linker path.

prattmic

prattmic commented on Aug 16, 2022

@prattmic
Member

FWIW, #54306 also has issues in the cgo tests with Alpine, though quite different errors.

gopherbot

gopherbot commented on Oct 29, 2023

@gopherbot
Contributor

Change https://go.dev/cl/538396 mentions this issue: crypto: implement AES-GCM-SIV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @prattmic@gopherbot@thanm@cherrymui

        Issue actions

          cmd/go,misc/cgo: problems with PIE builds on alpine builder · Issue #54354 · golang/go