From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 10 09:43:32 2022 Received: (at 57095) by debbugs.gnu.org; 10 Aug 2022 13:43:32 +0000 Received: from localhost ([127.0.0.1]:46958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLlzg-0005s7-6r for submit@debbugs.gnu.org; Wed, 10 Aug 2022 09:43:32 -0400 Received: from jpoiret.xyz ([206.189.101.64]:41836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLlzV-0005ro-K4 for 57095@debbugs.gnu.org; Wed, 10 Aug 2022 09:43:31 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id A93F5184F2C; Wed, 10 Aug 2022 13:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1660139000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=esvlO3QoUIJTDhuQjFlJx7ghQb7/btOOknAxZ+lJHHg=; b=P2xj+Wm7yrWNvWpP0Zi6x6D4Rzrs+90H3KS0+v9BLiRrcXBJXQ86wqCLwr/d1Dv9Lxr+36 ElQywRNRjYtLR6EEVNUEhNKAbn43NfLsW04zTE+Z2hiZ+C9kY8XwxJFwOWBFDjppDsMKPF RevJAObF0NGhA1R5eJ2eR4oZ4YxSWeI06uLV0Y0GtOiIBmap8hw7AhGnHB8SGKn8m6dym2 m2bQf4+Q9COsEque4vMXO2+yOhnjvGfYVangVxMuagX5732vCqGIzhOlGP1udGi/qV69tA yowTyIs63/CskSRHjGEJAzj20svML1NRe6EZASsg9QQh/7C2bPEPOcTl1J7rCQ== From: Josselin Poiret To: Csepp , 57095@debbugs.gnu.org Subject: Re: bug#57095: another "inappropriate ioctl" bug :) In-Reply-To: <874jylf1v8.fsf@riseup.net> References: <874jylf1v8.fsf@riseup.net> Date: Wed, 10 Aug 2022 15:43:18 +0200 Message-ID: <87bkssjjt5.fsf@jpoiret.xyz> MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-Spamd-Bar: / X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi! Csepp writes: > ``` > ./pre-inst-env guix import pypi -r linode-cli | tee -a gnu/packages/python-xyz.scm > > ... > In guix/build/syscalls.scm: > 2284:35 1 (_) > 2273:8 0 (terminal-window-size _) > > guix/build/sysc [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 57095 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.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi! Csepp writes: > ``` > ./pre-inst-env guix import pypi -r linode-cli | tee -a gnu/packages/python-xyz.scm > > ... > In guix/build/syscalls.scm: > 2284:35 1 (_) > 2273:8 0 (terminal-window-size _) > > guix/build/sysc [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FROM_SUSPICIOUS_NTLD From abused NTLD 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hi! Csepp writes: > ``` > ./pre-inst-env guix import pypi -r linode-cli | tee -a gnu/packages/python-xyz.scm > > ... > In guix/build/syscalls.scm: > 2284:35 1 (_) > 2273:8 0 (terminal-window-size _) > > guix/build/syscalls.scm:2273:8: In procedure terminal-window-size: > In procedure terminal-window-size: Inappropriate ioctl for device > ``` > > I assume the progress bar code does not gracefully handle the very > common case when stdout is not a terminal. There is some code in place to handle this issue, and it works most of the time, but not here. The issue is that we handle any error coming from ioctl by first throwing a `'system-error`, and handling it with a `catch` that checks whether the errno is ENOTTY (and deprecated equivalents) and in that case falls back to a good default. In the case where the error is not of that type, it is rethrown. This works well in most cases, but here comes the Guile shenanigans: We also use a big wrapping `with-error-handling` to display errors properly in the case when they are not caught. The difference is that `with-error-handling` adds a non-unwinding handler, while catch is unwinding. My first thought was that non-unwinding handlers, even outer ones would get priority over unwinding ones, since once the stack's unwound you can't really go back (I have no idea if that last part is actually true). In practice this is actually false, I tested with a very simple example, but that lead me to test by setting `#:unwind? #t` for the `guard*` definition in guix/ui.scm and the issue went away, so I'm clueless as to why this happens. What seems weird is that the error is not caught at all! Does anyone have a clue? Best, -- Josselin Poiret