-
Notifications
You must be signed in to change notification settings - Fork 180
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
panic: runtime error: index out of range [0] with length 0 [darwin/arm64] [M1] #153
Comments
test suite failing from c27aed5go: downloading github.com/smartystreets/goconvey v1.6.4 go: downloading github.com/jtolds/gls v4.20.0+incompatible go: downloading github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d unexpected fault address 0x1044f6028 fatal error: fault [signal SIGBUS: bus error code=0x1 addr=0x1044f6028 pc=0x1044f6028] |
If use a different method, it doesn't work at all: t.Run("should return a list of people", func(t *testing.T) {
calledWithUrl := "initial value"
stub := func(req *fasthttp.Request, resp *fasthttp.Response) error {
calledWithUrl = string(req.URI().FullURI())
body := "[{\"id\": 1, \"name\": \"test-name\", \"email\": \"test-email\"}]"
resp.SetBody([]byte(body))
return nil
}
gm.ApplyFunc(fasthttp.Do, stub)
defer gm.Reset()
result, err := FetchPeople("http://test-url")
assert.Nil(t, err)
assert.Equal(t, "http://test-url/", calledWithUrl)
assert.Equal(t, 1, len(result))
assert.Equal(t, 1, result[0].ID)
assert.Equal(t, "test-name", result[0].Name)
assert.Equal(t, "test-email", result[0].Email)
}) error from docker and localruntime: g 22: unexpected return pc for github.com/kilianc/base-golang.TestFetchPeople.func4 called from 0x300000000000000 stack: frame={sp:0x40000f9e60, fp:0x40000f9ed0} stack=[0x40000f8000,0x40000fa000) 0x00000040000f9d60: 0x0202010100000000 0x000000000000001c 0x00000040000f9d70: 0x0000000000000030 0x0000000000000020 0x00000040000f9d80: 0x00000040000febf0 0x000000400010e4b0 0x00000040000f9d90: 0x00000040000b4500 0x0000004000083a00 0x00000040000f9da0: 0x00000040000b01b0 0x00000040000b4540 0x00000040000f9db0: 0x0000000000686508 0x00000040000fea80 0x00000040000f9dc0: 0x00000040000ec380 0x0000000000000000 0x00000040000f9dd0: 0x0000000000000000 0x00000000002b6aa0 0x00000040000f9de0: 0x0000004000083b8c 0x0000000000000030 0x00000040000f9df0: 0x00000040000b01b0 0x00000000002b6b20 0x00000040000f9e00: 0x0000000000686460 0x00000040000fea80 0x00000040000f9e10: 0x0000000000000003 0x00000040000f9dd8 0x00000040000f9e20: 0x0000000000000000 0x00000040000f9e28 0x00000040000f9e30: 0x0000000000313dfc 0x0000000000686460 0x00000040000f9e40: 0x00000000003c3df9 0x000000400010a460 0x00000040000f9e50: 0x0000000000000001 0x0000000000000001 0x00000040000f9e60: <0x0300000000000000 0x00000040000ec380 0x00000040000f9e70: 0x00000040000fea80 0x0000000000448c0a 0x00000040000f9e80: 0x0000000000000000 0x0000000000000000 0x00000040000f9e90: 0x0000000000313480 0x00000040000ec380 0x00000040000f9ea0: 0x00000000003134e0 0x00000040000fea80 0x00000040000f9eb0: 0x000000000059e120 0x00000000006293c0 0x00000040000f9ec0: 0x0000000000000000 0x0000000000000000 0x00000040000f9ed0: >0x0000000000000000 0x0000004000093e90 0x00000040000f9ee0: 0x0000004000093ea0 0x0000004000093f58 0x00000040000f9ef0: 0x00000000001242c8 0x00000000003d6b20 0x00000040000f9f00: 0x000000000000002a 0x0000049ea8e0d757 0x00000040000f9f10: 0x00000000006293c0 0x0000004000093f48 0x00000040000f9f20: 0x00000000000a6c1c 0x0000000065765826 0x00000040000f9f30: 0x000000400ed7c24b 0x0ed7c24b00000000 0x00000040000f9f40: 0x0000000065765826 0x0000004000093f58 0x00000040000f9f50: 0x0000004000083860 0x0000004000093fa8 0x00000040000f9f60: 0x0000000000124f7c 0x0000000000000000 0x00000040000f9f70: 0x0300000000000000 0x0000000000124340 0x00000040000f9f80: 0x0000004000083860 0x0000000000124390 0x00000040000f9f90: 0x0000004000083860 0x0000004000093f78 0x00000040000f9fa0: 0x0000004000093f88 0x0000000000000000 0x00000040000f9fb0: 0x0000000000084ad4 0x0000004000083860 0x00000040000f9fc0: 0x00000000003fbdd8 0x0000000000000000 fatal error: unknown caller pc |
more logs with the latest changes, 2 failed out of 100 local runs, but almost 80% failure in docker. error from docker and localgo version go1.21.5 darwin/arm64 Run 1 PASS ok github.com/kilianc/base-golang 0.460s Run 2 PASS ok github.com/kilianc/base-golang 0.266s Run 3 PASS ok github.com/kilianc/base-golang 0.266s Run 4 PASS ok github.com/kilianc/base-golang 0.232s Run 5 PASS ok github.com/kilianc/base-golang 0.266s Run 6 PASS ok github.com/kilianc/base-golang 0.257s Run 7 PASS ok github.com/kilianc/base-golang 0.264s Run 8 PASS ok github.com/kilianc/base-golang 0.245s Run 9 PASS ok github.com/kilianc/base-golang 0.271s Run 10 PASS ok github.com/kilianc/base-golang 0.259s Run 11 PASS ok github.com/kilianc/base-golang 0.261s Run 12 PASS ok github.com/kilianc/base-golang 0.271s Run 13 PASS ok github.com/kilianc/base-golang 0.267s Run 14 PASS ok github.com/kilianc/base-golang 0.251s Run 15 PASS ok github.com/kilianc/base-golang 0.237s Run 16 PASS ok github.com/kilianc/base-golang 0.248s Run 17 PASS ok github.com/kilianc/base-golang 0.257s Run 18 PASS ok github.com/kilianc/base-golang 0.263s Run 19 PASS ok github.com/kilianc/base-golang 0.264s Run 20 PASS ok github.com/kilianc/base-golang 0.202s Run 21 PASS ok github.com/kilianc/base-golang 0.210s Run 22 PASS ok github.com/kilianc/base-golang 0.242s Run 23 PASS ok github.com/kilianc/base-golang 0.255s Run 24 PASS ok github.com/kilianc/base-golang 0.262s Run 25 PASS ok github.com/kilianc/base-golang 0.270s Run 26 PASS ok github.com/kilianc/base-golang 0.221s Run 27 PASS ok github.com/kilianc/base-golang 0.462s Run 28 PASS ok github.com/kilianc/base-golang 0.544s Run 29 PASS ok github.com/kilianc/base-golang 0.234s Run 30 PASS ok github.com/kilianc/base-golang 0.230s Run 31 PASS ok github.com/kilianc/base-golang 0.236s Run 32 PASS ok github.com/kilianc/base-golang 0.224s Run 33 PASS ok github.com/kilianc/base-golang 0.236s Run 34 --- FAIL: TestFetchPeople (0.00s) --- FAIL: TestFetchPeople/should_return_a_list_of_people (0.00s) fetchpeople_test.go:47: Error Trace: /Users/kciuffolo/workspace/base-golang/fetchpeople_test.go:47 Error: Expected nil, but got: &errors.errorString{s:"test-error"} Test: TestFetchPeople/should_return_a_list_of_people fetchpeople_test.go:48: Error Trace: /Users/kciuffolo/workspace/base-golang/fetchpeople_test.go:48 Error: Not equal: expected: "http://test-url/" actual : "initial value" |
do you solve? |
no |
@kilianc @SmallSmartMouse why not try https://github.com/xhd2015/xgo? |
@kilianc Sorry but found that I have replied in another place. Let me issue a PR for you |
@kilianc @SmallSmartMouse I created a PR here: kilianc/base-golang#3 |
https://github.com/kilianc/base-golang/blob/da0a110c1a5afb8cfa810282485d3dc5181040ee/fetchpeople_test.go
I am getting intermittent failures in tests and panic.
Repro
run
https://github.com/kilianc/base-golang/blob/da0a110c1a5afb8cfa810282485d3dc5181040ee/go-test.sh
on a M1 and it will fail about 50% of the timesrun
https://github.com/kilianc/base-golang/blob/da0a110c1a5afb8cfa810282485d3dc5181040ee/docker.sh
on a M1 and it will not failSucceeds on
go version go1.21.5 linux/arm64
and failsgo version go1.21.5 darwin/arm64
Full log:
The text was updated successfully, but these errors were encountered: