Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thanm opened this issue Aug 9, 2022 · 4 comments
Open

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

thanm opened this issue Aug 9, 2022 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@thanm
Copy link
Contributor

thanm commented Aug 9, 2022

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.

@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 9, 2022
@thanm thanm added this to the Backlog milestone Aug 9, 2022
@gopherbot
Copy link
Contributor

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

gopherbot pushed a commit that referenced this issue Aug 9, 2022
Skip a collection of -buildmode=pie tests on alpine, which are
currently failing on the linux-amd64-alpine builder. Once #54354 has
been investigated and resolved we can turn these tests back on.

Updates #54354.

Change-Id: I99d4016a40873ee6bb4eda571a64eddbe719c76a
Reviewed-on: https://go-review.googlesource.com/c/go/+/422295
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
@cherrymui
Copy link
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.

jproberts pushed a commit to jproberts/go that referenced this issue Aug 10, 2022
Skip a collection of -buildmode=pie tests on alpine, which are
currently failing on the linux-amd64-alpine builder. Once golang#54354 has
been investigated and resolved we can turn these tests back on.

Updates golang#54354.

Change-Id: I99d4016a40873ee6bb4eda571a64eddbe719c76a
Reviewed-on: https://go-review.googlesource.com/c/go/+/422295
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
@prattmic
Copy link
Member

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

@gopherbot
Copy link
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
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants