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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29295 invoked from network); 16 Dec 2022 03:24:04 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2022 03:24:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Subject:Cc:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=CcqhsrpAp/ZYQLgR8r4p4T5TYFb07LUucyVQVOch1fI=; b=Crr9KRWn4gBm09xuOfDpn1DBDi hj37EvnPwyoPUL/aKYLEqSSgFQRl+7X2eEf07MltIDmKni8E0SlfUDA6U7r23UWsRPJBl1JzgD9g1 /VWu46THzRQHp2ohuChT652KBndDIIxcHTjh/Hd4zlwqrFqEunGULza1MDNJO8khdp02OpG4roAfP GShSoeawwJVk79+zZOpXUjPfiLUhIHboY+GJ5S5a2RLaKtLSAlh3y/OdPo4nr2O5k+YqG3zxEU51V oJ0PSzOzO7YNmFHnSqQtNcKVuepFv1t0p9Up9hbpCgKsLS/OnFaezQEbO+wkgLJyNVvGalAFOpYpD PzaMRULw==; Received: by zero.zsh.org with local id 1p61KO-00032G-7u; Fri, 16 Dec 2022 03:24:04 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p61JR-0002JV-UB; Fri, 16 Dec 2022 03:23:06 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 864F127C0054; Thu, 15 Dec 2022 22:23:04 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute1.internal (MEProxy); Thu, 15 Dec 2022 22:23:04 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeigdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpefnrgif rhgvnhgtvgcugggvlhojiihquhgviicuoehlrghrrhihvhesiihshhdrohhrgheqnecugg ftrfgrthhtvghrnhepheegieduieegvddvffdvgeefuddugfetvdettddtfedutdejvefg jefgveethedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheplhgrrhhrhihvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeh udekjeejtdegqdduudelvdejfeekhedqlhgrrhhrhihvpeepiihshhdrohhrghesfhgrsh htmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: iaa214773:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5007031A0063; Thu, 15 Dec 2022 22:23:04 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 Mime-Version: 1.0 Message-Id: <46161d8a-c177-4134-836e-592e5c048887@app.fastmail.com> In-Reply-To: References: <0c2b1f8f-35bb-cd52-3d22-0964a73945b2@eastlink.ca> Date: Thu, 15 Dec 2022 22:21:56 -0500 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Ray Andrews" Cc: zsh-users@zsh.org Subject: Re: uninvited members of associative array Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 28547 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Thu, Dec 15, 2022, at 9:56 PM, Ray Andrews wrote: > On 2022-12-15 18:09, Dominik Vogt wrote: >> Probability of 95% or more that the array gets modified after the >> initialisation by some stray code. Put prints all over the place >> to find the place where the array gets modified. > > Nope, I showed the output directly after the init.=C2=A0 If something = goes=20 > wrong, it goes wrong during the init itself. Or before. > Lawrence: > >> It makes no sense to question the code before verifying that your > data isn't garbage. > > All the named keywords have exactly correct data, there's nothing not=20 > to like as far as that. Dunno, it wouldn't be the first time that=20 > there was some silly issue in the printout, no real problem at all, so=20 > my first question assumed nothing. Wrong. It assumed that "main" contained the expected data and nothing extra. I've already asked you to use "typeset -p" to verify its actual contents, but you still haven't. > I think I'm on the scent, the array is global. If I zero it before al= l=20 > the assignments (they're just numbers, no need to show the full=20 > genealogy of them), then the interlopers disappear. If you're implementing this in one of your sourced scripts, then you should clear "main" anyway, or you risk reusing a preexisting array. > So now the=20 > question is where the bogus elements come from. They aren't actually=20 > assigned anywhere, that's for sure. I don't trust your judgment on this. > Variable crosstalk? How does an=20 > associative array get corrupted? Let me root around a bit ... > hey ... you don't suppose a zcurses crash might do it? It's far more likely that you've been using a preexisting array or are inadvertently assigning to "main" from a function or your dotfiles or another location you haven't considered than that you've encountered a bug in zsh or zcurses. --=20 vq