You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and nothing happens, the program is still alive. Interestingly, in LLDB on Linux is sometimes does receive the signal
On Linux in LLDB
$ lldb ./test
(lldb) target create "./test"
Current executable set to './test' (x86_64).
(lldb) run
Process 28461 launched: './test' (x86_64)
registered in pid 28461
kill -17 28461
Process 28461 stopped and restarted: thread 1 received signal: SIGCHLD
SIGNAL
SIGNAL!
Process 28461 exited with status = 9 (0x00000009)
(lldb)
(the kill was run from some other terminal here).
Swift versions:
macOS
$ swiftc --version
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9
Linux
swiftc --version
Swift version 3.0.2 (swift-3.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu
but this also happens with this Swift version
swiftc --version
Swift version 3.1-dev (LLVM 5c165fb715, Clang e540ba0c30, Swift 3d3fdecbb4)
Target: x86_64-unknown-linux-gnu
which is master from 1st Feb 2017
The text was updated successfully, but these errors were encountered:
The problem appears to be in dispatch_sigsuspend (invoked as a result of calling dispatch_main to hang up the main thread and avoid it becoming a zombie).
It calls sigsuspend with an empty sigset. As a result, the signal gets masked out and not delivered to the signalfd. If I include SIGCHLD in the sigset being passed to sigsuspend, then the SignalSource fires correctly.
Attachment: Download
Additional Detail from JIRA
md5: cb7e513f2c891ab499ed2e68f4d8a5f4
Issue Description:
Description
Signals don't get delivered on `DispatchSourceSignal` on Linux. As a repro, run the following program
and then execute the line that it writes ("
kill -...
")on macOS
as expected, the program prints "SIGNAL", then "SIGNAL!" and then kills itself.
On Linux
and nothing happens, the program is still alive. Interestingly, in LLDB on Linux is sometimes does receive the signal
On Linux in LLDB
(the kill was run from some other terminal here).
Swift versions:
macOS
Linux
but this also happens with this Swift version
which is
master
from 1st Feb 2017The text was updated successfully, but these errors were encountered: