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,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 3394ae50 for ; Wed, 25 Sep 2019 14:02:15 +0000 (UTC) Received: (qmail 1631 invoked by alias); 25 Sep 2019 14:02:09 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24285 Received: (qmail 9204 invoked by uid 1010); 25 Sep 2019 14:02:09 -0000 X-Qmail-Scanner-Diagnostics: from smtpq3.tb.ukmail.iss.as9143.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25580. spamassassin: 3.4.2. Clear:RC:0(212.54.57.98):SA:0(-2.7/5.0):. Processed in 2.684874 secs); 25 Sep 2019 14:02:09 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _mailcloud.virginmedia.com designates 212.54.57.98 as permitted sender) X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-users@zsh.org X-SourceIP: 172.25.160.137 X-CNFS-Analysis: v=2.3 cv=Ab/P4EfG c=1 sm=1 tr=0 a=wOjQ4in9RKFG6jhXMc4Ghg==:117 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=gOSvBUeqVWgA:10 a=IkcTkHD0fZMA:10 a=Q79uFLovbU4A:10 a=sfOm8-O8AAAA:8 a=hD80L64hAAAA:8 a=yxwWEzee-6aUbe1-PkMA:9 a=QEXdDO2ut3YA:10 a=TvTJqdcANYtsRzA46cdi:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1569420087; bh=GFD/r0aymJzb6droLotA0ENdj8daWbs7f5DrgW/tDq8=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=vyzBqmzzN8QronQUzlA+u/W+P+bDKmOlr/qWi/GdpotDNHtcOkyVbMFVw/6tE0YjM LPWuUGDKBimtLx7Yjjw22AGa7moNxE3Ecx2uvEFCIzWw6s2GBVjoNaDRlAEj3XoQXT z8IdlhL8NDcHGt7dPmEsOPy3CTL4cUERc0VnUurmi6N3l14gg6RwgQkzEzhy1ajCJq qezQw7A08b+jvIZRJMFw9Fshwy07chkKeme7AcnAl4++JUcGCwREpTvnta5a6jzHlA JBgyIQn6KGsDyANb3EK9uf9bwvnyruH2m85x4FLdIqekAzv+/s6nEbc03hqLUzLXeF 6NY2FzP4I+lVg== Date: Wed, 25 Sep 2019 15:01:27 +0100 (BST) From: Peter Stephenson To: Dennis Schwartz Cc: zsh-users@zsh.org Message-ID: <1394985674.3969083.1569420087673@mail2.virginmedia.com> In-Reply-To: References: <1569314663.5531.4.camel@samsung.com> Subject: Re: TRAPINT doesn't work reliably MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev51 X-Originating-IP: 165.225.81.116 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4wfNFg7lWGTInde934yM04/TkAz7Usaked9hpYWec8wlAkwwPwkRBBfmt6azH2PC7dBgOSY1wNl7vlvACnJ+p/OaRG0xpSwyzHPoq/dHJZLyq8GD2ti9pO tLUJfAvxjB9pb5fDy04Usz97l+2FaCnfPijJu1PM40C7a7rS+51lkKZPVxFYigOSH3yq5M+n/joSRSNoM1DKKvXXrY8+AH2k5EDUTmNHyHpKXArXZBt2/dzR KPfVPIDcXMa5ExwnGDSQkQ== > On 25 September 2019 at 14:02 Dennis Schwartz wrote: > On Tuesday, September 24, 2019 10:44 AM, Peter Stephenson wrote: >> On Tue, 2019-09-17 at 16:47 +0000, Dennis Schwartz wrote: >>> I have a function on TRAPINT in my .zshrc like described as in the Zsh = manual [1]. >>> =C2=A0 >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0TRAPINT() { >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0echo "trap: $1" >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return $(( 128 + = $1 )) >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} >>> >>> >>> This works unreliably. Usually this works a first few times, but >>> after a while this doesn=E2=80=99t work anymore and throws the followin= g >>> error. >>> >>> TRAPINT:1: command not found: \M-^A^A >>> TRAPINT:2: command not found: F^\V > > It almost looks like the function gets replaced with random memory. > `functions TRAPINT` just shows random bytes, for example: >=20 > $ xxd <(functions TRAPINT) > 00000000: 5452 4150 494e 5420 2829 207b 0a09 0701 TRAPINT () {.... > 00000010: 200a 0950 200a 7d0a ..P .}. > > I am now more convinced it's a bug in Zsh. Any advice on how to debug thi= s? > And where can I best submit a bug report to? You don't need to submit a further separate bug report. Memory errors are tricky, and often hard to reproduce since allocation is heavily OS specific, but probably your best bet is to run with valgrind --leak-check=3Dfull zsh which should produce sensible results --- the shell shouldn't leak memory and anything that looks anomalous is probably a real bug ("still reachable" memory is OK). I'd also suggest trying the latest firmware from git or sourceforge, since there have been some memory fixes (and a release is probably overdue). cheers pws