Open jangler opened 9 years ago
Will definitely investigate. But I'm afraid it could be a Go problem and the way Go handles signals.
Actually, I think that my changes in PR #99 might fix this. There really isn't any reason to require O_ASYNC or SIGIO with Go & goroutines. Can you please try it out?
This works for me with rev 5c94acc5e6eb520f1bcd183974e01171cc4c23b3 with the following code:
termbox.Close()
syscall.Exec("/bin/sh", []string{"sh"}, os.Environ())
Something termbox sets up with O_ASYNC/SIGIO leaves a bad state for an exec(3)'d process. If the following program is invoked without command-line arguments, it (correctly) loops indefinitely. If it is invoked with arguments, it will crash after a few iterations, printing "I/O possible".
The problem is fixed by not setting the O_ASYNC flag in Init() (which is obviously not a workable solution), but it is not fixed by unsetting the flag in Close() and/or by using signal.Stop() on the SIGIO channel.
An equivalent C program does not have this problem.
My environment is go version 1.4.2, Linux kernel version 4.0.1.