-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: program got a SIGBUS signal #31593
Comments
Thanks for the report. It's possible that this is caused by issues with the cgo part of your program. It's possible that the bug is in the C code of your program, and not in the Go runtime. Can you provide a (possibly small) reproducer? Otherwise it won't be possible to investigate this. |
Thanks, @ALTree . the codes are too large, so I didn't post it here. I will mimic a simple one to reproduce it. BTW, can you give me some tips about what kinda scenario I will get this error? |
this is the associated issue, WAVM/WAVM#151 , its maybe helpful. |
@ALTree https://github.com/WAVM/WAVM/blob/master/Lib/Platform/POSIX/Thread.cpp#L148 is the source of SIGBUS. |
@duanbing Thanks for the investigation. Unfortunately, as I wrote above, this kind of crashes are often caused by issues in the C code, so I'm afraid this issue won't be actionable from the Go project's side unless you're able to to reduce your large code into a smaller reproducer. I'll leave this open with a |
I fixed it by allocating the memory in mmapped section, not in current stack. Thanks all! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes, go version go1.12.4 darwin/amd64 is the latest version I can download.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I write a cgo program, and use go test to run the unit test.
but if I set GOGC=off, go test run as I expect.
What did you expect to see?
tests finished without crash when GOGC=on.
What did you see instead?
I got SIGBUS signal if I just run
go test
.The text was updated successfully, but these errors were encountered: