-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: with GDB, callstack falls into infinite loop with CGO on GOOS=linux GOARCH=arm64 #37238
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
Comments
at linux/arm64, with the following code, the problem also exists: package main
import "C"
import (
"fmt"
"time"
)
func loop() {
for i := 0; i < 100000000; i++ {
fmt.Println("hello")
time.Sleep(time.Second)
}
}
func main() {
go loop()
time.Sleep(time.Minute * 2)
} go build main.go
|
Thank you @iswade for this report, the reproducing code and welcome to the Go project! I’ll kindly loop in some CGO, runtime and arm64 experts: @randall77 @cherrymui @zhangfannie @aclements @ianlancetaylor |
crosscall1 is basically the bottom of the stack. Maybe we could do something so gdb has the correct unwind info. It does not affect program execution. |
Hi, is anyone looking into the issue, I'd like to take a look if needed. thanks. |
@shawn-xdji I see no assignee and no gerrit change, so I assume nobody is working on this. Feel free to take it. |
Thanks for confirming. |
Hi @iswade, I got a local fix, am trying to test more scenarios, is it feasible to create a sample case for the c-shared flow you mentioned? Thanks. |
@shawn-xdji c-shared flow is a big project and it is not open source, sorry cannot do it. I think the sample code is enough.
|
Change https://golang.org/cl/226999 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.13.8 linux/arm64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="arm64"
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build664418125=/tmp/go-build -gno-record-gcc-switches"
What did you do?
run go developped program
What did you expect to see?
program run normally
What did you see instead?
program run normally but the callstask seems fall into infinite loop:
Application(C language) calls library1.so(Golang), and library1.so(Golang) call another library2.so(C language) with cgo.
We build the library1.so with -buildmode=c-shared, and it is used as dynamic library.
The problem only exists at linux/arm64.
The problem does not exists at linux/amd64.
The text was updated successfully, but these errors were encountered: