From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8LSXO5DG82JAaQAAbAwnHQ (envelope-from ) for ; Wed, 10 Aug 2022 16:54:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6NVvO5DG82K2FAAA9RJhRA (envelope-from ) for ; Wed, 10 Aug 2022 16:54:08 +0200 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 73B493E031 for ; Wed, 10 Aug 2022 16:54:08 +0200 (CEST) Received: from localhost ([::1]:44262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLn5z-00006h-0q for larch@yhetil.org; Wed, 10 Aug 2022 10:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLn5v-00006I-I8 for bug-guix@gnu.org; Wed, 10 Aug 2022 10:54:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLn5u-0004mH-8D for bug-guix@gnu.org; Wed, 10 Aug 2022 10:54:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLn5t-0002EW-VA for bug-guix@gnu.org; Wed, 10 Aug 2022 10:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#57095: another "inappropriate ioctl" bug :) Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 10 Aug 2022 14:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57095 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Josselin Poiret Cc: 57095@debbugs.gnu.org, Csepp Received: via spool by 57095-submit@debbugs.gnu.org id=B57095.16601432218555 (code B ref 57095); Wed, 10 Aug 2022 14:54:01 +0000 Received: (at 57095) by debbugs.gnu.org; 10 Aug 2022 14:53:41 +0000 Received: from localhost ([127.0.0.1]:50435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLn5Y-0002Dv-DZ for submit@debbugs.gnu.org; Wed, 10 Aug 2022 10:53:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLn5W-0002Dh-IN for 57095@debbugs.gnu.org; Wed, 10 Aug 2022 10:53:39 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLn5Q-0004jm-Ln; Wed, 10 Aug 2022 10:53:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=FkICelX0t0ZI2LIspmlBj45LCZim4KGtzLMBHZRz/Gs=; b=ZgBBPmGBNcwkzTIHu5cz BdTk7LgkQoHO1S9OoXox6I+LEu3hYV+78zGPc4wQbgJBAge1jbzNdbmxgZY2Zuwn0mgdWhu2coSCj 00hrmZeoIJKLE3sL+izknJlm53ZHlTdKdf4ivn3Tf6t7wgvtzBjD5ssjMpqiwuHyM/svtBMMBYltb LsNdT9XgqsIPPlvgb4EU/HsVdvmV0DyLpOSfrfhYjdjBZLW5ZfGCqM+whbMYYr/4ZxWhXaOo+/6e+ PjLKm9q6nZDBwaGZ2JJE2OypI2x8LbjBVzRNi6zFrbMU9pt7ZGCzGfSlR4uu0cEjvF6w44hSc4yni Z4x2hfRaSG5CrQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:51654 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLn5Q-0001cb-9Y; Wed, 10 Aug 2022 10:53:32 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <874jylf1v8.fsf@riseup.net> <87bkssjjt5.fsf@jpoiret.xyz> Date: Wed, 10 Aug 2022 16:53:29 +0200 In-Reply-To: <87bkssjjt5.fsf@jpoiret.xyz> (Josselin Poiret's message of "Wed, 10 Aug 2022 15:43:18 +0200") Message-ID: <87lerwywt2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660143248; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=FkICelX0t0ZI2LIspmlBj45LCZim4KGtzLMBHZRz/Gs=; b=lXBWmMKUvq7AnloY5ci6tzUqrcRnq1pIyXZetwsRr3JOF4gaAlUN4ot5cxYKuYQ6ejLSQT k+anS9wPd6NpdJJRdcVisWeD7mlM4CVE+KwN39u8rx2htE5S7tyFd6oMNn/gTJbtRq9fpW jGxRIHEdOSMWOOISLYZsi5D7SXUxSFL2kmH17WfE5uceMXei9hYOHy88WBKwY/VV5oVhaJ DIThJCW3QH2U0NXJJSViNNaa40l9i6RV/ECrbBK0M1cskmb4vdPQ3TWaJ+qxAC5bY+ZMFu zTfEmj+1b66v7iYZ7GpQ+uPPP7cwj1yZbR9E1iyYM5YvAjboa46IHbgHfEP8fA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660143248; a=rsa-sha256; cv=none; b=KCsFPiOT5XXRufS9Q53TUxgMeFLA0vG+59TIryGn37AyCDEUX/tucRYF2MG6KnvKp+hi4V +8BIENmzP3xyOZP3MhLRsdOizhVDDEfi32SLvC9W/FcKhbGNpzx6Ffb9Nu/RpDkeeMUqHm hQcexs5jRh1fWVMR9hLKo014ZEK5H6PMwp6shVZj513tEHeYN4NP2lAebY1X/G8k/9ZVaV hN6IfMGot9warpo6qI2Tt9vdGVk1doQHKbSyEVX7oA2/WndodxooeY1tFqsHlD5DHA0I/Q FPn1DtUipJ44k0NJrSZU080wRitAANgPVKbU5P1ELUOAB0ooM8SycW8120M35g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=ZgBBPmGB; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.29 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=ZgBBPmGB; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 73B493E031 X-Spam-Score: -2.29 X-Migadu-Scanner: scn1.migadu.com X-TUID: hUSojVRnAqm5 Hi! Josselin Poiret skribis: > 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! The inner handler, even if it=E2=80=99s unwinding and the outer one is not, appears to have higher precedence: --8<---------------cut here---------------start------------->8--- scheme@(guix read-print)> (with-exception-handler (lambda args (pk 'outer a= rgs)) (lambda () (with-exception-handler (lambda args (pk 'inner args)) (lambda() (rmdir "/")) #:unwind? #t)) #:unwind? #f) ;;; (inner (#<&compound-exception components: (#<&external-error> #<&origin= origin: "rmdir"> #<&message message: "~A"> #<&irritants irritants: ("Devic= e or resource busy")> #<&exception-with-kind-and-args kind: system-error ar= gs: ("rmdir" "~A" ("Device or resource busy") (16))>)>)) $17 =3D (#<&compound-exception components: (#<&external-error> #<&origin or= igin: "rmdir"> #<&message message: "~A"> #<&irritants irritants: ("Device o= r resource busy")> #<&exception-with-kind-and-args kind: system-error args:= ("rmdir" "~A" ("Device or resource busy") (16))>)>) scheme@(guix read-print)> (with-exception-handler (lambda args (pk 'outer a= rgs)) (lambda () (catch 'system-error (lambda () (rmdir "/")) (lambda args (pk 'inner args)))) #:unwind? #f) ;;; (inner (system-error "rmdir" "~A" ("Device or resource busy") (16))) $18 =3D (system-error "rmdir" "~A" ("Device or resource busy") (16)) --8<---------------cut here---------------end--------------->8--- This appears to work: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(guix build syscalls) scheme@(guile-user)> (terminal-columns) $19 =3D 119 scheme@(guile-user)> ,use(guix ui) scheme@(guile-user)> (with-error-handling (terminal-columns)) $20 =3D 119 scheme@(guile-user)> (terminal-columns (open-input-string "")) $21 =3D 143 scheme@(guile-user)> (with-error-handling (terminal-columns (open-input-str= ing ""))) $22 =3D 143 --8<---------------cut here---------------end--------------->8--- Needs more investigation=E2=80=A6 Ludo=E2=80=99.