-
Notifications
You must be signed in to change notification settings - Fork 188
SIGCHILD handling in Mac OS #26
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
Comments
FWIW using |
Please note that these calls are not coming from the qml package. The qml package is just calling back onto the test code at:
Everything above it is not logic from qml. It also looks like a problem in the Go runtime. I'll report this upstream. |
Reported at http://golang.org/issue/7227 |
Are you still able to reproduce this issue? If so, can you please run it with GOTRACEBACK=2 and report back on http://golang.org/issue/7227? Thanks! |
Accidentally stepped on that rake too. My setup is OS X 10.9.3, Qt 5.3.0, Go — tested with both 1.3beta1 and 1.3beta2. The minimal reproducible code is package main
import (
"log"
"os/exec"
"gopkg.in/qml.v0"
)
func main() {
qml.Init(nil)
out, _ := exec.Command("date").Output() // [1]
log.Println(string(out))
engine := qml.NewEngine() // [2]
log.Println("Hello?")
_ = engine
} Program hangs if [1] is getting called after I've visited http://golang.org/issue/7227, but seems that there is no any solution yet. 😢 |
There's a workaround via monkeypatching sigaction et. al. tough |
@quarnster Are you using that in an app? Maybe we should just do something similar in the qml package itself, to fix the SIGCHILD situation in Mac OS. There's already some memory fiddling to enable testing (see testing.go), but I was not so unhappy about these given it was only for testing. That said, if there's no way to have SIGCHILD working at all otherwise, maybe we should also do that in general for these functions. |
I am using it in various apps that appear to be more stable with such a work around in place. However it isn't a catch all solution as applications can still try and override the signal handlers by using the syscall directly. It is nonetheless a viable workaround that I'm presuming would catch most issues. Reminder per this and this comment, it's enough to simply reset the signal handler trampoline on OSX for the issue to appear even if the signal handler itself isn't touched. This impacts any signal that any lib might try and install even if it's then trying to be "good" and chain the handlers as the standard library doesn't expose the ability to set the trampoline resulting in it getting overwritten when not using the syscall directly. While Linux allows signal handlers to be chained, the right flags must be used when installing the new handler, so it's still a potential issue on Linux. The actual code used is in hack.go and utils.c. cinit is used because doing for example I don't know of any issues caused by applying the monkey patching. |
With this piece of code:
I get this output:
Any ideas?
The text was updated successfully, but these errors were encountered: