From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22301 invoked from network); 16 May 2021 19:59:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 May 2021 19:59:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1621195178; b=flscvW5rihWIICJXf0ndLAtk78vfOkofObdkLixP6+WNjk/kLwANbYuCRZ6Nw8fKJDE22g0aSj sJtCPuhrlSJrBOACS4UfudYYje0e1a8DG1wVDAN79CAqxnt8AfWTBGpdIvNCK3Gp9bJ/2Crw2p 3RBWilyTH+9XZFXY4BpI+SWQLDoFNwPdWqQQU4SjMW8rqSMkiRgLwLk/HwCjchFHsE4MIxv9Rk JaNg1Uh9xr51p8qiT8HwNLYZglZrfZSujjezzAGcalVycMomX/SdGLUtAhWW9Tk5U1GErGG1Yt SIZiTfLpfnlyqohqlawg6Kpuaju0xZeg06r01KoSFq0aQA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f45.google.com) smtp.remote-ip=209.85.210.45; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1621195178; bh=Coo3r/glDyBb+L6pqCLrJOvdyMBs2azrg1ysTbYINms=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=VQ//jADeDQyZPRr8FpplrI8NC826u04bXMd+X7DfrZnaPK1cHFDKOMLk+7TZxuL6wpE3/FUwM8 7elSPcZlfhqhenntY/rHOx2bf1t0caylB9Yi8IfaP1QNHnKF5V1irInCIofWB3ugHY5V5NmzGb l3IIjtmqHFDZUjrMyn7L9cYYGq3iDof4fIZWtrYCzECqaImtY//M/20Cz+PPTsrSFjZLWGNc6c vDcwx7cmed2HqkS7dSdW6ti2j8Fm1oZgLsrxsh6+hYdowZ6eNG+qhlPXgX7pHuGqnn3z1EaU/9 YYi9J7502p+T6EckVnxY5ubUNdNhS//eFxOduDWaavIabg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ILCt2nnd9rqUfHJiVchFYTGaaHpysruHjJrfDfmmnhI=; b=GCzTwV8CLxhbfbt7RvSrYvomR9 ozpMxpC5PpEYsnzMt2ECfDtUgMRSHFANyUGOLnJUfRvVQyek18uKXPAXgd2OdlKN4Aa2/kyM/GODD NpDM/h7mvkttnukZ0cEykdaJ4x70HzXX8ab/CGAFSK+qB305TYxbkKxYFz64udsHpbP+FoH0GyEG4 mz8+bKXDs2f/IKVmzy9TMjYOYXRo17dYYaU9saPwhrmwdFu5PmpWQEWGpm0v/6NqM7hOjHH9dLibB x5Q4Ks5RBEmEepZG8CVHnoPZ47Sj+9jgn87zd+Qd7xb1IYi1wuWbeNslHFQHK3LOrGjAUucJp5MbG hBMNOyzg==; Received: from authenticated user by zero.zsh.org with local id 1liMvJ-000BcB-ON; Sun, 16 May 2021 19:59:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f45.google.com) smtp.remote-ip=209.85.210.45; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f45.google.com ([209.85.210.45]:38884) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1liMv6-000BMO-Jp; Sun, 16 May 2021 19:59:25 +0000 Received: by mail-ot1-f45.google.com with SMTP id q7-20020a9d57870000b02902a5c2bd8c17so3851961oth.5 for ; Sun, 16 May 2021 12:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ILCt2nnd9rqUfHJiVchFYTGaaHpysruHjJrfDfmmnhI=; b=lENn1wYEcm4M+Cft25Q0hnGAHYvCgY9c5t2Z8PucoaJp2LCB/CIkkGuoYHMXEQgLhu nlZmCrLB6LUCzd5miS9zSdfFIK455T7RsOclRhmqoTl77NVW5NdsvBEpiymtNL7cBH2Q soOmqsVjQKofJWEjdwsSGVUdBA7nTQgms3olHeOLgy1X8TiDOSR6RWgkkNOMr5YZAPSz 7oEHoGmbgaoWb2C0U5YR23IcN3WnaqAkTd5hopE6ISahEA17gyJg3gKztl+KFvvwLZ3r AzNnBSlwSSinw4C6oKPQxqva+Khd/R28ngiIVlynJ07uBXG51E1RdVoBSOY/6bgLN6yr jcww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ILCt2nnd9rqUfHJiVchFYTGaaHpysruHjJrfDfmmnhI=; b=BOIIYO/FiiChOazdyeuUUG+rmSthDaHI/ARsncbKBAoOgQbYcteDDJp2KLampcV60l wNF37hv26EzP3txG2bxBhPfcOoRFG/fXjAGt3IOc2/4IoIEACZDGievyBvb0yOwLqMUP PMaxUyG8gEgRyWA8Fra6Js1B0TPJK6GaBFdt1mw2WmahCVncE6+lNtOi9qSMtL2SEy+m 0x16ckMBy6QYmlvxhg5NzbvxoczPxeaYD8J2/p1DXJU7trfFyoGdpSy3MiPyBKJftSIE II5AImiPBmNmDfRMf5kU/azEEsTECtrdg0EH3ZtvIwmw27qlMZM2rhuRpf+LJRKBTnuk 16Vw== X-Gm-Message-State: AOAM532Cnhd4H6Ml6LGeDauWos8NEEGgM+X31VMfEfH7aWRRzwRie9UR SOZdnDDfqVbN5wpTpsX3og4ecJNidD4M9T1DTywLAjgikzDGgQ== X-Google-Smtp-Source: ABdhPJwn77jYBcwlGAax3zHauTGSZkHiL1MCGZfFIvaUNwEWlrs55AkHkLfUCm+JKAV8docmaj6WQJPD7C7Y/nmEFKY= X-Received: by 2002:a9d:170b:: with SMTP id i11mr42096935ota.161.1621195163174; Sun, 16 May 2021 12:59:23 -0700 (PDT) MIME-Version: 1.0 References: <97227908-8f84-65b6-a3b0-81c5e16d91d9@inlv.org> In-Reply-To: <97227908-8f84-65b6-a3b0-81c5e16d91d9@inlv.org> From: Bart Schaefer Date: Sun, 16 May 2021 12:59:11 -0700 Message-ID: Subject: Re: 'while do done' hangs interactive zsh To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48855 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Sun, May 16, 2021 at 11:25 AM Martijn Dekker wrote: > > Op 16-05-21 om 19:47 schreef Bart Schaefer: > > Let's try the attached, then? > > Interactive zsh with that patch still locks up on 'while do done' So this is MacOS: % TRAPINT() { print Got INT } % while do done ^CGot INT ^CGot INT ^CGot INT ^CGot INT ^CGot INT That's exactly what also happens on Ubuntu. But if I change that to: % TRAPINT() { print Got INT; break } Then on Ubuntu a ^C stops the loop, but on MacOS it does not. This implies that the value of the global "breaks" is not propagating into execwhile() when set from the signal handler. This may be an optimization problem with clang? Some random fiddling indicates that the value of "errflag" may not be propagating out of the signal handler either. Indeed, this seems to fix it for MacOS: diff --git a/Src/loop.c b/Src/loop.c index aa733a2cb..db5b3e097 100644 --- a/Src/loop.c +++ b/Src/loop.c @@ -43,7 +43,7 @@ mod_export int contflag; /* # of break levels */ /**/ -mod_export int breaks; +mod_export volatile int breaks; /**/ int Do we need to worry about compilers that don't accept "volatile"? I'd suggest throwing "volatile" into the computed definition of "mod_export" except I've forgotten whether there is such a thing as declaring a function to be volatile.