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

misc/cgo/test: static test fails #56623

Closed
aclements opened this issue Nov 7, 2022 · 4 comments
Closed

misc/cgo/test: static test fails #56623

aclements opened this issue Nov 7, 2022 · 4 comments
Labels
arch-loong64 Issues solely affecting the loongson architecture. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@aclements
Copy link
Member

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

581a822 in the Go 1.20 development tree

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

linux/loong64, observed on the trybots for CL 448016 PS 1

What did you do?

I've been enabling dist tests for cgo on more architectures where it's not clear why they're disabled. One of the misc/cgo/test static build configurations crashes on linux/loong64. It's unfortunately not easy to extract tests from dist (something I'm hoping to improve), but I believe this is what the test is doing:

cd $GOROOT/misc/cgo/test
CGO_LDFLAGS="-static -pthread" go test -short=true -count=1 -run= -tags=static .

What did you expect to see?

Test passes.

What did you see instead?

Test crashes with "signal: bus error" (trybot log)

/cc @golang/loong64

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

Change https://go.dev/cl/448016 mentions this issue: cmd/dist: add curiously missing GOOS/GOARCH combinations

@aclements aclements added the arch-loong64 Issues solely affecting the loongson architecture. label Nov 7, 2022
@abner-chenc
Copy link
Contributor

Thank you very much, I will try to solve this problem

gopherbot pushed a commit that referenced this issue Nov 16, 2022
The cmd/dist cgo_test enumerates a large number of platforms in
various special cases. Some combinations are suspiciously absent. This
CL completes the combinations.

I've confirmed using trybots that the newly-enabled tests pass on
android/* (this is not surprising because the gohostos is never
"android" anyway), windows/arm64, linux/ppc64 (no cgo), linux/loong64
(except for one test, filed #56623), linux/mips*, netbsd/arm (except
for one test, filed #56629), and netbsd/arm64. The windows/arm builder
is out to lunch, so I'm assuming that works. Since netbsd/arm and
arm64 mostly passed these tests, I've also enabled them on netbsd/386
and netbsd/amd64, where they seem to work fine as well.

Preparation for #37486.

Change-Id: I04c3348e4f422d74d51e714647ca3db379e6e919
Reviewed-on: https://go-review.googlesource.com/c/go/+/448016
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
@gopherbot
Copy link

Change https://go.dev/cl/416154 mentions this issue: cmd/internal/obj/loong64: save LR after decrementing SP

@xen0n
Copy link
Member

xen0n commented Feb 24, 2023

Another instance: https://build.golang.org/log/40befeb1926223b8194ffd6ff76777e20f81a434

CL 416154 is supposed to have this fixed though.

xen0n pushed a commit to xen0n/go that referenced this issue Mar 17, 2023
Refer to CL 413428 and 412474, for loong64, like mips, s390x and riscv, there
is no single instruction that saves the LR and decrements the SP, so we also
need to insert an instruction to save the LR after decrementing the SP.

Fixes golang#56623.
Updates golang#53374.

Change-Id: I3de040792f0a041d3d2a98ea89c23a2dd2f4ad10
johanbrandhorst pushed a commit to Pryz/go that referenced this issue Mar 28, 2023
Refer to CL 413428 and 412474, for loong64, like mips, s390x and riscv, there
is no single instruction that saves the LR and decrements the SP, so we also
need to insert an instruction to save the LR after decrementing the SP.

Fixes golang#56623.
Updates golang#53374.

Change-Id: I3de040792f0a041d3d2a98ea89c23a2dd2f4ad10
Reviewed-on: https://go-review.googlesource.com/c/go/+/416154
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: xiaodong liu <teaofmoli@gmail.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
xen0n pushed a commit to xen0n/go that referenced this issue May 1, 2023
Refer to CL 413428 and 412474, for loong64, like mips, s390x and riscv, there
is no single instruction that saves the LR and decrements the SP, so we also
need to insert an instruction to save the LR after decrementing the SP.

Fixes golang#56623.
Updates golang#53374.

Change-Id: I3de040792f0a041d3d2a98ea89c23a2dd2f4ad10
Reviewed-on: https://go-review.googlesource.com/c/go/+/416154
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: WANG Xuerui <git@xen0n.name>
Reviewed-by: xiaodong liu <teaofmoli@gmail.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
(cherry picked from commit 3ed8a1e)
@golang golang locked and limited conversation to collaborators Mar 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-loong64 Issues solely affecting the loongson architecture. FrozenDueToAge 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