From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 17 19:30:29 2021 Received: (at submit) by debbugs.gnu.org; 17 Jul 2021 23:30:29 +0000 Received: from localhost ([127.0.0.1]:54832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4tlM-0002sd-TD for submit@debbugs.gnu.org; Sat, 17 Jul 2021 19:30:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:40294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4tlJ-0002sS-9D for submit@debbugs.gnu.org; Sat, 17 Jul 2021 19:30:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4tlI-0002gt-VX for bug-guix@gnu.org; Sat, 17 Jul 2021 19:30:25 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:35543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4tlH-0006nQ-Ck for bug-guix@gnu.org; Sat, 17 Jul 2021 19:30:24 -0400 Received: by mail-qk1-x732.google.com with SMTP id q190so12782746qkd.2 for ; Sat, 17 Jul 2021 16:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=X7sSzONxAECzJsOfpoDfb4QmLZSsG4kyEfmx/c1ejpY=; b=rzsJgPrb/+HaFh1N4oyF1YW02yKCVm7lh8JO3vgQri+jXhEIipVdI51onm35xKb/io HP9ba12zSRh1Cxu5zZZ48pbamrs5U6jJbiLp0ubY0qvC1sOOqhlwsdCZVHBrx85sV5xQ LeAEfqNcYtM3Vj4ILL7blIXDaBZlsNd+2mZuWiAt+8U8g0XQX+k4xg5jEHdIPhiL5Tbk soCx4LErgddeDp66zhjkeHxnENqxL64EEa0uu/hgfSuYzYCANzUpT0B8vo+iMd8sQWr5 wfnsYHnAfoh/DXgi9HEvhggCop/ef6G0TV+FpqOcstUGPXrF8Z7BLPJXovNQjzE+sMJr hDrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=X7sSzONxAECzJsOfpoDfb4QmLZSsG4kyEfmx/c1ejpY=; b=raTUkYB9pQFJtHH0faCttJMvHi7/8ONP3lK0Q+NiSjcCYFlFZ/olTiAZMB4ZAUUJj7 A168txj3Qf3wovBys2kGbKdMEJqskiMaw/Z0QkhuDjIc6X+s/BRrTvLTf5WYIycxKwiA aX3gYGgIN9jPzQXT5ReFfXBgqRaxl4aj8dlKIJwopwDR41+Cs+OnEWPebaXBtUVeOkF6 jMqFtg3eYVM8+u28rwEKGt/yaIiIzzYh119UdzQxIe79XQ7p/85G52oXQvBkxzIRjhyt inbwU40wErEfUqLcT1i+M3Kb6alZLTt2gJbhdfntpDRxAJqzJJoSreDV/ympfR2tSlcZ MYbg== X-Gm-Message-State: AOAM530EMbVt+hbKniD7uFFVnCEIQvg+1ErX/Xe5e614uWQcwN54jTJQ +mO6Hh1zfue54Vzy83HY+wxtnGflFNsrpqAIJEPPbKneTx97cQ== X-Google-Smtp-Source: ABdhPJyYfKcmVy3X9OJVrajNwnjoxP7Zje8/pr4ZyT1XDLE+aU+1TQBfWp3vLD/LX4gvKZeLS+0FreNupTT+5A/rERM= X-Received: by 2002:a37:aad5:: with SMTP id t204mr17335473qke.444.1626564621505; Sat, 17 Jul 2021 16:30:21 -0700 (PDT) MIME-Version: 1.0 From: Anadon Date: Sat, 17 Jul 2021 19:30:10 -0400 Message-ID: Subject: On WSL1/2, guix install: error: cannot kill processes for uid `999': failed with exit code 1 To: bug-guix@gnu.org Content-Type: multipart/alternative; boundary="0000000000007816ab05c75a1695" Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=joshua.r.marshall.1991@gmail.com; helo=mail-qk1-x732.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --0000000000007816ab05c75a1695 Content-Type: text/plain; charset="UTF-8" Talking with iskarian on IRC, we've confirmed that guix successfully installs, almost successfully sets up (the init.d isn't set up to actually daemonize), but for `guix build`, `guix install` and `guix pull` all fail with "guix : error: cannot kill processes for uid `998': failed with exit code 1" when using WSL1/2. --0000000000007816ab05c75a1695 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Talking with iskarian on IRC, we've confirmed that gui= x successfully installs, almost successfully sets up (the init.d isn't = set up to actually daemonize), but for `guix build`, `guix install` and `gu= ix pull` all fail with "guix <SUB_CMD>: error: cannot kill proce= sses for uid `998': failed with exit code 1" when using WSL1/2.
--0000000000007816ab05c75a1695-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 18 00:20:33 2021 Received: (at 49613) by debbugs.gnu.org; 18 Jul 2021 04:20:33 +0000 Received: from localhost ([127.0.0.1]:55010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4yI4-0003Lk-Pp for submit@debbugs.gnu.org; Sun, 18 Jul 2021 00:20:33 -0400 Received: from out2.migadu.com ([188.165.223.204]:43654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4yI1-0003LZ-CS for 49613@debbugs.gnu.org; Sun, 18 Jul 2021 00:20:30 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1626582027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=p5c/Zan0lzAccqir4XwjxjFnPfnBy1XrAVfspLFD1C0=; b=eTfVyPWiOBuros3nM+rl4sV1Bbqr6vDdSE8Wr171Z+PxJA+E+9JR3ubiOVc/sVX9mtdyTT Z5LLz2Wozt66ZXmUpVfnUCAN0gmrSF04/h4vBt0bv2OXdsOHYc/Golu9IDzvsuIqKRar1v C2AAKjX10OixkPTP7jKOPukvuslhvpA= From: Sarah Morgensen To: Anadon Subject: Re: bug#49613: On WSL1/2, guix install: error: cannot kill processes for uid `999': failed with exit code 1 References: Date: Sat, 17 Jul 2021 21:20:25 -0700 In-Reply-To: (Anadon's message of "Sat, 17 Jul 2021 19:30:10 -0400") Message-ID: <86lf64tfqu.fsf@mgsn.dev> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 49613 Cc: 49613@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Guix, Anadon writes: > Talking with iskarian on IRC, we've confirmed that guix successfully > installs, almost successfully sets up (the init.d isn't set up to > actually daemonize), but for `guix build`, `guix install` and `guix > pull` all fail with "guix : error: cannot kill processes for > uid `998': failed with exit code 1" when using WSL1/2. I've investigated this a bit and it seems to be an issue with the return code from `kill` when no other processes owned by that user exist to kill. If I set a process to continually spawn with uid 998, I no longer encounter the above error. Also, if there is a zombie process under that uid, I no longer encounter the above error until I manually kill it. This is on WSL1; I do not know if this technique also applies to WSL2. For reference, the relevant portion of `nix/libutil/util.cc`: --8<---------------cut here---------------start------------->8--- Pid pid = startProcess([&]() { if (setuid(uid) == -1) throw SysError("setting uid"); while (true) { #ifdef __APPLE__ /* OSX's kill syscall takes a third parameter that, among other things, determines if kill(-1, signo) affects the calling process. In the OSX libc, it's set to true, which means "follow POSIX", which we don't want here */ if (syscall(SYS_kill, -1, SIGKILL, false) == 0) break; #elif __GNU__ /* Killing all a user's processes using PID=-1 does currently not work on the Hurd. */ if (kill(getpid(), SIGKILL) == 0) break; #else if (kill(-1, SIGKILL) == 0) break; #endif if (errno == ESRCH) break; /* no more processes */ if (errno != EINTR) throw SysError(format("cannot kill processes for uid `%1%'") % uid); } _exit(0); }); int status = pid.wait(true); #if __GNU__ /* When the child killed itself, status = SIGKILL. */ if (status == SIGKILL) return; #endif if (status != 0) throw Error(format("cannot kill processes for uid `%1%': %2%") % uid % statusToString(status)); --8<---------------cut here---------------end--------------->8--- Perhaps the way WSL handles the return code for ``kill` is not as expected? On a cursory inspection, though, the relevant parts of WSL2's kernel/signal.c seem the same as the vanilla Linux kernel... Or perhaps for some reason `kill(-1, SIGKILL)` under WSL is attempting to kill the calling process (why?) and failing, therefore returning an error. Note that the error code 1 reported by Guix does not seem to be the actual errno reported by `kill`. I've seen Guix working on WSL2 in the wild before [0] so this is a really odd error. I'm stumped. [0] https://github.com/giuliano108/guix-packages/blob/master/notes/Guix-on-WSL2.md -- Sarah