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/cgo: segfault, regression in go 1.15.3 #42085

Closed
bartle-stripe opened this issue Oct 20, 2020 · 5 comments
Closed

cmd/cgo: segfault, regression in go 1.15.3 #42085

bartle-stripe opened this issue Oct 20, 2020 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@bartle-stripe
Copy link

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

1.15.3

Bisecting reveals 9698372 it the culprit.

Does this issue reproduce with the latest release?

Yes

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

Reproduces on both macOS and linux,

What did you do?

go test github.com/bsm/go-sparkey/...

What did you expect to see?

No segfaults.

What did you see instead?

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x47cfa51]

runtime stack:
runtime.throw(0x43f28b2, 0x2a)
	/Users/bartle/src/go/src/runtime/panic.go:1116 +0x72
runtime.sigpanic()
	/Users/bartle/src/go/src/runtime/signal_unix.go:704 +0x48c

goroutine 19 [syscall]:
runtime.cgocall(0x433a1f0, 0xc000187090, 0xc000105680)
	/Users/bartle/src/go/src/runtime/cgocall.go:133 +0x5b fp=0xc000187060 sp=0xc000187028 pc=0x400785b
github.com/bsm/go-sparkey._Cfunc_sparkey_logiter_fill_value(0x8204080, 0x0, 0x200, 0xc000328000, 0xc00026e4b0, 0x0)
	_cgo_gotypes.go:272 +0x4d fp=0xc000187090 sp=0xc000187060 pc=0x431d44d
github.com/bsm/go-sparkey.(*valueReader).Read.func1(0xc00011c3c8, 0x200, 0xc000328000, 0xc00026e4b0, 0x4369b40)
	/Users/bartle/go/src/github.com/bsm/go-sparkey/iter.go:262 +0xb1 fp=0xc0001870e0 sp=0xc000187090 pc=0x4324091
github.com/bsm/go-sparkey.(*valueReader).Read(0xc00011c3c8, 0xc000328000, 0x200, 0x200, 0xc000328000, 0x0, 0x0)
	/Users/bartle/go/src/github.com/bsm/go-sparkey/iter.go:262 +0x70 fp=0xc000187120 sp=0xc0001870e0 pc=0x431fe90
bytes.(*Buffer).ReadFrom(0xc0001871c8, 0x8039118, 0xc00011c3c8, 0x8039118, 0xc000000000, 0x4007f1b)
	/Users/bartle/src/go/src/bytes/buffer.go:204 +0xb1 fp=0xc000187190 sp=0xc000187120 pc=0x40e9431
io/ioutil.readAll(0x8039118, 0xc00011c3c8, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/bartle/src/go/src/io/ioutil/ioutil.go:36 +0xe5 fp=0xc000187210 sp=0xc000187190 pc=0x40ef445
io/ioutil.ReadAll(...)
	/Users/bartle/src/go/src/io/ioutil/ioutil.go:45
github.com/bsm/go-sparkey.(*LogIter).Value(0xc000242ba0, 0xc00026e401, 0x2, 0x2, 0x0, 0x0)
	/Users/bartle/go/src/github.com/bsm/go-sparkey/iter.go:126 +0x90 fp=0xc000187260 sp=0xc000187210 pc=0x431f6b0
github.com/bsm/go-sparkey.(*HashIter).Get(0xc000219980, 0xc00026e4a8, 0x2, 0x2, 0xc000231940, 0x445dfa0, 0xc000187300, 0x40122b8, 0x2)
	/Users/bartle/go/src/github.com/bsm/go-sparkey/iter.go:175 +0x93 fp=0xc0001872a0 sp=0xc000187260 pc=0x431f933
github.com/bsm/go-sparkey.(*HashReader).Get(0xc00021b770, 0xc00026e4a8, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0)
	/Users/bartle/go/src/github.com/bsm/go-sparkey/hash.go:98 +0xe7 fp=0xc000187310 sp=0xc0001872a0 pc=0x431f007
github.com/bsm/go-sparkey.glob..func3.6()
	/Users/bartle/go/src/github.com/bsm/go-sparkey/hash_test.go:81 +0x4b2 fp=0xc0001873d8 sp=0xc000187310 pc=0x4326b32
github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc00011f0e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go:113 +0xa3 fp=0xc000187438 sp=0xc0001873d8 pc=0x42c6da3
github.com/onsi/ginkgo/internal/leafnodes.(*runner).run(0xc00011f0e0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go:64 +0xd7 fp=0xc0001875d8 sp=0xc000187438 pc=0x42c69b7
github.com/onsi/ginkgo/internal/leafnodes.(*ItNode).Run(0xc00012d160, 0x4457e20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/leafnodes/it_node.go:26 +0x67 fp=0xc0001876f8 sp=0xc0001875d8 pc=0x42c6067
github.com/onsi/ginkgo/internal/spec.(*Spec).runSample(0xc00025ea50, 0x0, 0x4457e20, 0xc0001548c0)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/spec/spec.go:215 +0x691 fp=0xc0001879e8 sp=0xc0001876f8 pc=0x42c9811
github.com/onsi/ginkgo/internal/spec.(*Spec).Run(0xc00025ea50, 0x4457e20, 0xc0001548c0)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/spec/spec.go:138 +0xf2 fp=0xc000187a38 sp=0xc0001879e8 pc=0x42c8f52
github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpec(0xc00024c8c0, 0xc00025ea50, 0x0)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:200 +0x111 fp=0xc000187a90 sp=0xc000187a38 pc=0x42ea0f1
github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).runSpecs(0xc00024c8c0, 0x1)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:170 +0x127 fp=0xc000187b18 sp=0xc000187a90 pc=0x42e9c07
github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run(0xc00024c8c0, 0xc000121f68)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:66 +0x117 fp=0xc000187b58 sp=0xc000187b18 pc=0x42e9417
github.com/onsi/ginkgo/internal/suite.(*Suite).Run(0xc00017a070, 0x8017320, 0xc000106600, 0x43e0d08, 0x7, 0xc0001136c0, 0x1, 0x1, 0x445f9e0, 0xc0001548c0, ...)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/suite/suite.go:79 +0x586 fp=0xc000187db8 sp=0xc000187b58 pc=0x42ebb46
github.com/onsi/ginkgo.RunSpecsWithCustomReporters(0x44582e0, 0xc000106600, 0x43e0d08, 0x7, 0xc000187f20, 0x1, 0x1, 0x4607603)
	/Users/bartle/go/src/github.com/onsi/ginkgo/ginkgo_dsl.go:229 +0x238 fp=0xc000187ed0 sp=0xc000187db8 pc=0x42f9738
github.com/onsi/ginkgo.RunSpecs(0x44582e0, 0xc000106600, 0x43e0d08, 0x7, 0x0)
	/Users/bartle/go/src/github.com/onsi/ginkgo/ginkgo_dsl.go:210 +0x168 fp=0xc000187f40 sp=0xc000187ed0 pc=0x42f9388
github.com/bsm/go-sparkey.TestSuite(0xc000106600)
	/Users/bartle/go/src/github.com/bsm/go-sparkey/sparkey_test.go:54 +0xf6 fp=0xc000187f80 sp=0xc000187f40 pc=0x431c376
testing.tRunner(0xc000106600, 0x4401840)
	/Users/bartle/src/go/src/testing/testing.go:1123 +0xef fp=0xc000187fd0 sp=0xc000187f80 pc=0x40fd0af
runtime.goexit()
	/Users/bartle/src/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc000187fd8 sp=0xc000187fd0 pc=0x4072f81
created by testing.(*T).Run
	/Users/bartle/src/go/src/testing/testing.go:1168 +0x2b3

goroutine 1 [chan receive]:
testing.(*T).Run(0xc000106600, 0x43e1e60, 0x9, 0x4401840, 0x4090926)
	/Users/bartle/src/go/src/testing/testing.go:1169 +0x2da
testing.runTests.func1(0xc000106480)
	/Users/bartle/src/go/src/testing/testing.go:1439 +0x78
testing.tRunner(0xc000106480, 0xc000185de0)
	/Users/bartle/src/go/src/testing/testing.go:1123 +0xef
testing.runTests(0xc00012ca00, 0x46d30c0, 0x1, 0x1, 0xbfdb9ed7f33c93c0, 0x8bb2ddb255, 0x46f5540, 0x4011950)
	/Users/bartle/src/go/src/testing/testing.go:1437 +0x2fe
testing.(*M).Run(0xc0001ac180, 0x0)
	/Users/bartle/src/go/src/testing/testing.go:1345 +0x1eb
main.main()
	_testmain.go:47 +0x138

goroutine 20 [chan receive]:
github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).registerForInterrupts(0xc00024c8c0, 0xc000102300)
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:223 +0xce
created by github.com/onsi/ginkgo/internal/specrunner.(*SpecRunner).Run
	/Users/bartle/go/src/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go:60 +0x86

goroutine 22 [syscall]:
os/signal.signal_recv(0x0)
	/Users/bartle/src/go/src/runtime/sigqueue.go:144 +0x9d
os/signal.loop()
	/Users/bartle/src/go/src/os/signal/signal_unix.go:23 +0x25
created by os/signal.Notify.func1.1
	/Users/bartle/src/go/src/os/signal/signal.go:150 +0x45
FAIL	github.com/bsm/go-sparkey	0.274s
FAIL
@bartle-stripe
Copy link
Author

Broken off from #42076
cc @randall77

@bartle-stripe bartle-stripe changed the title Segfault, regression in go 1.15.3 cgo segfault, regression in go 1.15.3 Oct 20, 2020
@cagedmantis cagedmantis changed the title cgo segfault, regression in go 1.15.3 cmd/cgo: segfault, regression in go 1.15.3 Oct 21, 2020
@cagedmantis
Copy link
Contributor

@bartle-stripe Would it be possible to extract/isolate a sample portion of the code which leads to the segfault?

@cagedmantis cagedmantis added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 21, 2020
@randall77
Copy link
Contributor

@bartle-stripe I think CL 264300 might fix this. Can you try it?

@randall77
Copy link
Contributor

(And thus, would be a dup of #42032 .)

@bartle-stripe
Copy link
Author

Yup, confirmed cherry-picking that fixes my test.

@golang golang locked and limited conversation to collaborators Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants