From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 1058113f for ; Tue, 30 Jul 2019 21:55:31 +0000 (UTC) Received: (qmail 28567 invoked by alias); 30 Jul 2019 21:55:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44612 Received: (qmail 16937 invoked by uid 1010); 30 Jul 2019 21:55:25 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk1-f180.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(209.85.221.180):SA:0(-2.0/5.0):. Processed in 2.983879 secs); 30 Jul 2019 21:55:25 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.180 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=g2ctI6YbIGmqMR+OKnC99fhamW2vBM5ilYTevdOBIuY=; b=ULotat9BzMkb9wR2kSf1qE3HG5o/d8ngQtTiDhZnWlaG6ZZ/4SLfEkRTiYhZC9lo4d T5wnaQhkj7WNIBj1zX9mKAoK1JfjYrO1uegM4264cCp2IQTFhdnAqiiv1S+f53UEM4dT WltYuPeXJcb9hIJ4zLNxiYq9IfrrzhWiaZhLsJbYf0LVYPiSyv41v+TPYgL/THfR2Wuh CC/9lWseC89OZ6ks6TRVmgXBlah4Kbgm2wKHzDq/oMBKJzciwhIy/Rhm3a8LUu0oUfO7 1hSsjog7smmpLk3umy2SqlbpaTF89fTEIXeQvDV89uCzS/XAiHaaLe/23HfcBYK7NIDC y3Gw== 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:cc:content-transfer-encoding; bh=g2ctI6YbIGmqMR+OKnC99fhamW2vBM5ilYTevdOBIuY=; b=VALJfQ8NI7lXQlmK5j5hdRtCnm9GjH35wahTTvg8y/+zFE96qMGWeXmrbSvsxuPj8d PIHsx2nAW0YCVSOkGtkU+TUvoNHUeBCgaXYg5CEYTrs7P1+8n8Nnx4T/CrQq8Q0wy1TR WGQD0G/eQePnw5+Wt8WlELwG0pn88XJOQe1nN1p8RwbFymeg4QePeqgIIM5GZP8kozEi J/yIe/OaOZ9zzcUsSMrO6Qux8P4ArsmU5sLxPLt9BQmoGefwrcTxq17uRBF2SeXkiCSZ JDZGnkB+BluVc37lqUxH2+O2Fykfum8YEn8L0hUl+AwY3I6l82+s82p8CG9qPJS1v6of J4Eg== X-Gm-Message-State: APjAAAVc9XE4d0/IcvEyU7CIuHZvmSW/8m/Fm6dZhUSOb3Mz3tieiLVP XXLxnKrLhyCuDYYurU+n7yp1InSIX6Fpz57vZR8= X-Google-Smtp-Source: APXvYqyp/Z2at+53VB/ZkbXd6Mdv7IKDlRW6f53M5JXbE+v3SAs1NjXbIZXyzajO01WRNwY4n6vH3/cMQn3t0rg0wPQ= X-Received: by 2002:a1f:d507:: with SMTP id m7mr36361316vkg.11.1564523689742; Tue, 30 Jul 2019 14:54:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Tue, 30 Jul 2019 23:54:38 +0200 Message-ID: Subject: =?UTF-8?Q?Re=3A_A_serious_bug_in_execution_=E2=80=93_where_to_debug=3F?= To: Roman Perepelitsa Cc: Bart Schaefer , Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 30 Jul 2019 at 23:45, Roman Perepelitsa wrote: > > On Tue, Jul 30, 2019 at 11:38 PM Sebastian Gniazdowski > wrote: > > > > On Tue, 30 Jul 2019 at 23:02, Roman Perepelitsa > > wrote: > > >> On Tue, 30 Jul 2019 at 20:28, Bart Schaefer wrote: > > >> > If you change the [[ ... ]] && ... to an if/then, does the behavio= r change? > > >> > If you add a "return" or "return $?" at the end of the function, d= oes it change? > > >> > > >> a) yes, the problem cancels with if-then > > >> b) no, adding one of the return's doesn't change the behavior > > > > > > I think Bart solved it. Do you have `emulate -L zsh` in your `zle` fu= nction? > > > > No, but adding it helps. Any emulation (sh, ksh) does. Aah, so this is > > the errreturn option set within your plugin! and the if-then was > > setting the return code to 0. A very interesting situation, having > > your code called in foreign context, to know what options to defend > > from. > > You should call `emulate -L zsh` from every functions that can be > called by any code other than yours. It's almost impossible to write I avoided localoptions for performance =E2=80=93 it consumes some time, as = it (probably, but the performance effect is confirmed) allocates a new table of options and fills it with defaults. So I've decided to write an option-transparent code. But turns out that this might be hard in case of such options as errreturn. I'll think about whether to replace inline conditions with if-then or to do emulate -L. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org