-
Notifications
You must be signed in to change notification settings - Fork 200
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
Govips panics on shutdown #144
Comments
@davidbyttow any thoughts? Any callbacks at exit related to the stats collection perhaps? |
Oh interesting. Well, stat collector shouldn't be started unless it is specified to be. But, that may be a red herring because there are no callbacks there. This seems possibly like vips itself is calling into something on shutdown? In any case, I haven't looked too closely, but need to spend some time on this in the next day or two to understand/debug. |
I tried scanning the Libvips sources and for sure there's an atexit() routine there but it's just C stuff to clean up the cache etc. According to the stack trace it's trying to call Go code after exit, so it's not Libvips, it needs to be something in Govips. |
Well, are we sure? Couldn't it just be the logging handler? If libvips is logging something after Go has shutdown due to atexit, that would cause the bad stackframe error, no? |
You're a genius @davidbyttow. That must be it. I'll try a patch as soon as I have 15min. |
The fix wasn't immediately obvious to me, but I was able to reproduce locally and so here's a fix: https://github.com/davidbyttow/govips/compare/fix-%23144?expand=1 |
Fixed with latest commit. Upstream will also fix Go runtime bug in Go 1.16 |
There's a randomly appearing bug where Govips appears to try to call a Go callback on shutdown() even after the Go runtime has already exited. I've also reported it to the golang tracker and it seems it might be a bug in the macOS implementation of go:
golang/go#42465
It's annoying and unprofessional, to get a stack trace when your program exits. None the less it's not strictly breaking anything.
Is there anything we might do in Govips to prevent this behaviour? Are there any callbacks registered to be run on exit? It's causing our CI tests to fail for macOS at the moment for both macOS versions:
https://github.com/davidbyttow/govips/runs/1565811797
https://github.com/davidbyttow/govips/runs/1565999906
The text was updated successfully, but these errors were encountered: