From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: bug#30365: Offloading sometimes hangs Date: Thu, 15 Feb 2018 01:06:04 +0100 Message-ID: <20180215010604.29cf5694@scratchpost.org> References: <877erq8med.fsf@gnu.org> <87o9l0zzk1.fsf@gnu.org> <87mv0hwy75.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1em74t-00046w-BB for bug-guix@gnu.org; Wed, 14 Feb 2018 19:07:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1em74o-0006T2-Dd for bug-guix@gnu.org; Wed, 14 Feb 2018 19:07:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:35564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1em74o-0006Sw-9v for bug-guix@gnu.org; Wed, 14 Feb 2018 19:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1em74o-0005Ru-0S for bug-guix@gnu.org; Wed, 14 Feb 2018 19:07:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87mv0hwy75.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30365-done@debbugs.gnu.org Hi Ludo, > On the Guile side, we=E2=80=99ll have to push the fix for > . Can't think of a way to test select. But can think of a way to test pselec= t: Excuse the C: #include #include #include #include #include static void dummy(int signum) { } int main() { int fds[2]; struct sigaction sa =3D { .sa_handler =3D dummy, .sa_flags =3D 0, }; sigemptyset(&sa.sa_mask); pipe(fds); /* Make sure we don't miss it */ sigsetmask(sigmask(SIGCHLD)); /* Make sure we handle it once we DO get it (after unblocking it :P) */ sigaction(SIGCHLD, &sa, NULL); if (fork() =3D=3D 0) { _exit(0); /* Cause SIGCHLD (to be at least pending) in the = parent. */ } else { close(fds[0]); fd_set read_set; fd_set write_set; fd_set except_set; sigset_t sigmask; int rc; FD_ZERO(&read_set); FD_ZERO(&write_set); FD_SET(fds[1], &write_set); FD_ZERO(&except_set); sigemptyset(&sigmask); /* unblock SIGCHLD */ rc =3D pselect(fds[0] + 1, &read_set, &write_set, &except_s= et, NULL, &sigmask); if (rc =3D=3D -1) { perror("select"); } else if (rc =3D=3D 0) { printf("ZERO\n"); } else { printf("N\n"); } } return 0; }