From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kD1CBDis82C8NgAAgWs5BA (envelope-from ) for ; Sun, 18 Jul 2021 06:21:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ADd0Ozes82ASVAAAbx9fmQ (envelope-from ) for ; Sun, 18 Jul 2021 04:21:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 694F11F2C1 for ; Sun, 18 Jul 2021 06:21:11 +0200 (CEST) Received: from localhost ([::1]:34052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4yIf-0004SB-Qa for larch@yhetil.org; Sun, 18 Jul 2021 00:21:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4yIY-0004Pc-4b for bug-guix@gnu.org; Sun, 18 Jul 2021 00:21:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4yIX-0007Qs-U5 for bug-guix@gnu.org; Sun, 18 Jul 2021 00:21:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m4yIX-0003Mc-Lt for bug-guix@gnu.org; Sun, 18 Jul 2021 00:21:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#49613: On WSL1/2, guix install: error: cannot kill processes for uid `999': failed with exit code 1 Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 18 Jul 2021 04:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49613 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Anadon Cc: 49613@debbugs.gnu.org Received: via spool by 49613-submit@debbugs.gnu.org id=B49613.162658203312884 (code B ref 49613); Sun, 18 Jul 2021 04:21:01 +0000 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= 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-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Sarah Morgensen From: Sarah Morgensen via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626582071; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=p5c/Zan0lzAccqir4XwjxjFnPfnBy1XrAVfspLFD1C0=; b=f94WiIT4V3cIl1TA9Bf0QeFZxae87pw0pCCgnuXKPBItcuTaoK1Cn4Og4+vQn+2L0+tfuc DyQGXcWRfkAkRhJC5XQGOy6VQr5vCqKhX8rY+/EB0f/j3hUGG6YnEQoBG4PaT2oXcmwvvD mgo9tImMRtT/4EI7D3oKSEcMd2KtKmHkRNDzyFnoz3WjA6nvvgS+VNo6sNCjedIwJb/jAW d3smYuPPYNKugetZGC4GYsQlFSQR0XWqdMpGUDnzg8fkELWybK+1ahhES2kSOvYkasyZ4Q PYaOyWkQX/m3SLBvRvELvrhCTg6W5iHEJOPu6EDK87tfhlFWp7CKIBscjjxnNg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626582071; a=rsa-sha256; cv=none; b=Czoosyh9DO/VlMYzzpljoTcLYrLMsJJVvUPAYjGROqtmpbhjzGG5arrYmuKV/KQ+1O6Gn6 3SU49XbG9KPASXmYkWMu8qWH8CCKGi7lYCIKJYHRAB1SkYERLl0ovWVImqB57vjTxqWnFp UBpnq94NcyEIvhxfpmvIi94/wNzpHuRF2dHeyoGeX79ek8W5jOfAFdATStD1f5l4YHr8Cs A3jwkXgOThn+7LnYWtL9dnY3IAlnA56k7mf8OUiRBz7tSPMy4WUCLm+mag6Gd3ZlyuSTgm BLB8enQjBO1Lzn+qLv7eYgTehMQEDK+wkxsWOqyTUmwuWH5pB+5pOk1VL3osrQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=eTfVyPWi; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=eTfVyPWi; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 694F11F2C1 X-Spam-Score: -2.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: rtn6Z+amOnaG 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