-
Notifications
You must be signed in to change notification settings - Fork 17.3k
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
runtime: error on exit of program on darwin fatal error: exitsyscall: syscall frame is no longer valid #42465
Comments
From the stack trace it looks like when Go calls |
Does runtime.setfinalizer() count? Likely not? I've got a couple of deferred functions in main() but they're both wrapped before that as well? |
No. I mean, something like C |
A reproduce: Go file:
C file:
Running on darwin it fails with the same stack trace as above. On (most of) other platforms we directly call syscall exit when the runtime exits. On darwin (maybe all libc platforms), maybe we should call |
fatal error: exitsyscall: syscall frame is no longer valid
on exit of program
I agree that we should call |
Change https://golang.org/cl/269378 mentions this issue: |
My C library does some cleanup with an atexit() by clearing cache and releasing some file handles or stuff like that but it's a pure C library, it doesn't call any Go code. It's not even aware of Go. The library in question is libvips 8.10.2. |
@ianlancetaylor @cherrymui it's now reproducible in my CI runs: https://github.com/davidbyttow/govips/runs/1565627149 https://github.com/davidbyttow/govips/runs/1563672162?check_suite_focus=true Perhaps related to #24656 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yeah, 1.15.4 is the latest.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran a small POC program (
go run cmd/poc/main.go
) which utilises the govips library (cgo bridge to libvips, a C library) to manipulate an image:https://github.com/tonimelisma/govips-poc <- please use commit fdc047e
The program runs correctly. Optionally, at the end, I can run the vips.Shutdown() function which frees up memory etc. but as you can see, this line is commented out.
Instead, at program exit, when it's supposed to clean up, I get a stack dump.
N.B. the stack dump only happens on my macOS, it doesn't happen when running the program on my linux environment (Ubuntu Groovy).
What did you expect to see?
Successful program exit
What did you see instead?
The text was updated successfully, but these errors were encountered: