From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#33239: 'guix offload' regularly hangs in 'channel-get-exit-status' call Date: Fri, 02 Nov 2018 11:57:06 +0100 Message-ID: <87k1lvrblp.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]:45461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIX9W-0002ZZ-1Y for bug-guix@gnu.org; Fri, 02 Nov 2018 06:58:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIX9T-0002gl-Li for bug-guix@gnu.org; Fri, 02 Nov 2018 06:58:09 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIX9O-0002e0-Td for bug-guix@gnu.org; Fri, 02 Nov 2018 06:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gIX9O-0003FQ-P5 for bug-guix@gnu.org; Fri, 02 Nov 2018 06:58:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIX8d-0001IT-GW for bug-guix@gnu.org; Fri, 02 Nov 2018 06:57:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIX8Z-0002CK-Ty for bug-guix@gnu.org; Fri, 02 Nov 2018 06:57:13 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIX8X-0002Bc-L4 for bug-guix@gnu.org; Fri, 02 Nov 2018 06:57:11 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42504 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gIX8W-00074R-1L for bug-guix@gnu.org; Fri, 02 Nov 2018 06:57:09 -0400 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: 33239@debbugs.gnu.org Hello, The =E2=80=98guix offload=E2=80=99 processes on berlin regularly hang while= calling =E2=80=98channel-get-exit-status=E2=80=99: --8<---------------cut here---------------start------------->8--- (gdb) bt #0 0x00007f299fb330f1 in __GI___poll (fds=3D0x1dd58c0, nfds=3D1, timeout= =3D-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007f2994287577 in ssh_poll_ctx_dopoll () from target:/gnu/store/wmp= g67bn7i7pqc0p4xjp1npnqixk9znd-libssh-0.7.6/lib/libssh.so.4 #2 0x00007f29942884d9 in ssh_handle_packets () from target:/gnu/store/wmpg= 67bn7i7pqc0p4xjp1npnqixk9znd-libssh-0.7.6/lib/libssh.so.4 #3 0x00007f29942885ad in ssh_handle_packets_termination () from target:/gn= u/store/wmpg67bn7i7pqc0p4xjp1npnqixk9znd-libssh-0.7.6/lib/libssh.so.4 #4 0x00007f2994275080 in ssh_channel_get_exit_status () from target:/gnu/s= tore/wmpg67bn7i7pqc0p4xjp1npnqixk9znd-libssh-0.7.6/lib/libssh.so.4 #5 0x00007f29946dd11a in guile_ssh_channel_get_exit_status () from target:= /gnu/store/i3nfl17wfx7sryq6w15r9wxl7ilmq4rb-guile-ssh-0.11.3/lib/libguile-s= sh.so.11 #6 0x00007f29a1765965 in vm_regular_engine (thread=3D0x1dd58c0, vp=3D0x1d4= df30, registers=3D0xffffffff, resume=3D-1615646479) at vm-engine.c:786 #7 0x00007f29a1768fba in scm_call_n (proc=3D#, argv= =3Dargv@entry=3D0x7ffc76b1ece8, nargs=3Dnargs@entry=3D1) at vm.c:1257 #8 0x00007f29a16ecff7 in scm_primitive_eval ( exp=3Dexp@entry=3D((@ (ice-9 control) %) (begin ((@@ (ice-9 command-lin= e) load/lang) "/gnu/store/zz3b7j4iv6v143v7cqyr77k83zc5n3zw-guix-0.15.0-6.f9= a8fce/bin/.guix-real") (main (command-line)) (quit)))) at eval.c:662 #9 0x00007f29a16ed053 in scm_eval ( exp=3D((@ (ice-9 control) %) (begin ((@@ (ice-9 command-line) load/lang= ) "/gnu/store/zz3b7j4iv6v143v7cqyr77k83zc5n3zw-guix-0.15.0-6.f9a8fce/bin/.g= uix-real") (main (command-line)) (quit))), module_or_state=3Dmodule_or_stat= e@entry=3D"#" =3D {...}) at eval.c:696 #10 0x00007f29a1738220 in scm_shell (argc=3D11, argv=3D0x1dd5280) at script= .c:454 (gdb) frame 0 #0 0x00007f299fb330f1 in __GI___poll (fds=3D0x1dd58c0, nfds=3D1, timeout= =3D-1) at ../sysdeps/unix/sysv/linux/poll.c:29 29 in ../sysdeps/unix/sysv/linux/poll.c (gdb) p *fds $1 =3D {fd =3D 14, events =3D 1, revents =3D 0} (gdb) shell ls -l /proc/12605/fd total 0 lr-x------ 1 root root 64 Nov 2 11:20 0 -> 'pipe:[44413497]' l-wx------ 1 root root 64 Nov 2 11:33 1 -> 'pipe:[44413496]' lr-x------ 1 root root 64 Nov 2 11:33 10 -> 'pipe:[44459532]' l-wx------ 1 root root 64 Nov 2 11:33 11 -> 'pipe:[44459532]' lr-x------ 1 root root 64 Nov 2 11:33 12 -> 'pipe:[44429590]' l-wx------ 1 root root 64 Nov 2 11:33 13 -> 'pipe:[44429590]' lrwx------ 1 root root 64 Nov 2 11:33 14 -> 'socket:[44444783]' lrwx------ 1 root root 64 Nov 2 11:33 15 -> 'socket:[44444784]' l-wx------ 1 root root 64 Nov 2 11:33 16 -> /var/guix/offload/141.80.167.1= 40/0 l-wx------ 1 root root 64 Nov 2 11:33 2 -> 'pipe:[44413496]' lr-x------ 1 root root 64 Nov 2 11:33 3 -> 'pipe:[44459528]' lr-x------ 1 root root 64 Nov 2 11:33 33 -> /dev/urandom l-wx------ 1 root root 64 Nov 2 11:33 4 -> 'pipe:[44413498]' l-wx------ 1 root root 64 Nov 2 11:33 5 -> 'pipe:[44459528]' lr-x------ 1 root root 64 Nov 2 11:33 6 -> 'pipe:[44459531]' l-wx------ 1 root root 64 Nov 2 11:33 7 -> 'pipe:[44459531]' lr-x------ 1 root root 64 Nov 2 11:33 8 -> 'pipe:[44453928]' l-wx------ 1 root root 64 Nov 2 11:33 9 -> 'pipe:[44453928]' --8<---------------cut here---------------end--------------->8--- I believe this is because in (guix ssh) we don=E2=80=99t ensure the remote process is dead by the time we call =E2=80=98channel-get-exit-status=E2=80= =99, as in this example: --8<---------------cut here---------------start------------->8--- scheme@(guix ssh)> (define s (open-ssh-session "localhost" #:user "ludo" #:= port 22)) scheme@(guix ssh)> (define c (open-remote-pipe* s OPEN_BOTH "sleep 1000")) scheme@(guix ssh)> (channel-send-eof c) $4 =3D # scheme@(guix ssh)> (channel-get-exit-status c) ;; hangs --8<---------------cut here---------------end--------------->8--- Problem is that calling =E2=80=98channel-get-exit-status=E2=80=99 on a clos= ed port doesn=E2=80=99t work, so forcing a port close isn=E2=80=99t really an optio= n: --8<---------------cut here---------------start------------->8--- scheme@(guix ssh)> (define c (open-remote-pipe* s OPEN_BOTH "sleep 100")) scheme@(guix ssh)> (close-port c) $4 =3D #t scheme@(guix ssh)> (channel-get-exit-status c) ERROR: In procedure channel-get-exit-status: In procedure channel-get-exit-status: Wrong type argument in position 1 (ex= pecting open channel): # --8<---------------cut here---------------end--------------->8--- To be continued=E2=80=A6 Ludo=E2=80=99.