-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Using Fibers causes epic crash #46
Comments
This is the bare minimum required to make fibers work within the go runtime.
This is the bare minimum required to make fibers work within the go runtime.
This is the bare minimum required to make fibers work within the go runtime.
@dunglas the following Docker file (props @cdaguerre in #374) appears to "fix" fibers. At least for this reproducer with manual testing. It needs more testing:
🥳 🤞 🤞 still testing... |
Great news! Don't hesitate to open a PR with this changes, so we can see if this fix the issue for all architectures. |
I'll do some proper testing by Monday (by updating the fiber branch), but I haven't seen a crash yet via manual testing. |
@withinboredom I had issues with fibers so I could also test this on my Cloud Run service but not really sure where can I get docker image to use with this fix. |
It doesn't fix it, per se, more-or-less just reduces the probability of a crash. Edit to add: the best way to prevent a crash is to just not output anything at all inside a fiber. |
I've just encountered this issue and using the workaround from @withinboredom did resolve the exception. In this project the culprit seem to be the monolog logger as that is the only place fibers are being used. |
I started working on a cgo library several weeks ago to allow output from c to go without calling go. It's still a wip: https://github.com/withinboredom/cgoc There's a segfault once the number of concurrent requests gets high (due to usage of some C synchronization primitives from go), and a memory leak, but the it's pretty fast by itself (~8gbs on my machine). I hope to have it working sometime in the next few months as a potential solution. |
@withinboredom IMHO the best option would be to fix the issue directly in Go! |
@dunglas I highly doubt it will ever be fixable, for very valid reasons. The reason it is failing boils down to the following:
According to the CL (https://go-review.googlesource.com/c/go/+/530480) this means changing the stack for an If we can fix the ncgo issue, then we are free to muck around with the stack as much as we want. |
One way to fix it might be to have |
According to golang/go#62130 (comment), this seems fixable directly in Go for our case. |
Minimal code to reproduce:
With some slight modifications, it can also be reproduced in worker mode.
The text was updated successfully, but these errors were encountered: