[Sshpass-devel] sshpass hang in pselect
Brought to you by:
thesun
From: jason <huz...@gm...> - 2019-03-29 12:46:30
|
Hello, I encountered several times that sshpass hang forever in pselect() while child is defunct. It seems child failed to send SIGCHLD or sshpass lost it. Then I looked at the code and this line https://sourceforge.net/p/sshpass/code/HEAD/tree/trunk/main.c#l219 may have problem. If the child run so fast, it can terminate and kernel send SIGCHLD before sshpass run into pselect() which will hang forever. According to https://lwn.net/Articles/176911/ may be we need to do SIG_BLOCK the SIGCHLD before forking the child and unblock it by pselect(). So sshpass will not lost signal. Is it really a bug here or I am not clear with it? Please help to take look. Many thanks. |