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 2760 invoked from network); 12 Feb 2023 08:00:17 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Feb 2023 08:00:17 -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:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:References:From:In-reply-to:cc:Reply-To: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZyI0zl30ugaScts5/oEqHxp/dN3JuKderxREw6VOvW0=; b=dLmvRHepXEfuu98LI6nEqtc4Vo 0DCmjabGxF/V12sAG82ALqwD+CzFSYIMxJS7zv67ojV2lTF+XPyuff9GZOJQ2O2hzNB8uViv5YJPs OVAvDOtJcvSJ3dIEYykSZdXlkiQOeMHtbi1GJfBEVWpjM+uOdYBZJvKwK/N7bT+YLp0xIo5irrhC8 zyNAtFJHVSww/g2W2h7fbX5L0G5ZXp6g993p7LCEDHXzU8iobOspKzg8kqWG3aKfvKUlVS6gVJfRi bDwx61CCUNIT6aFNzEooYr5iweB2SuKYg8LPROzSgqQPzA/byqs6rRedtidSNfbG2AOU5jHflPOrI wRB4tnyg==; Received: by zero.zsh.org with local id 1pR7HV-000HN7-Cc; Sun, 12 Feb 2023 08:00:17 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1pR7HJ-000H3x-RK; Sun, 12 Feb 2023 08:00:05 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.95) (envelope-from ) id 1pR7HI-000NsH-JK; Sun, 12 Feb 2023 09:00:04 +0100 cc: Zsh hackers list In-reply-to: From: Oliver Kiddle References: <67689-1675827940.088548@BxvG.D9_b.7RzI> <12608-1675903622.800470@Xj82.e3y1.svhG> <66045-1675975796.128039@FBF_.0yMO.Y8fk> To: Bart Schaefer Subject: Re: Speaking of dangerous referents MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <91775.1676188804.1@hydra> Date: Sun, 12 Feb 2023 09:00:04 +0100 Message-ID: <91776-1676188804.595308@S3xK.VfOi.LVPX> X-Seq: 51406 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: Bart Schaefer wrote: > % empty=() > % loop='empty[${(P)loop}]' > % print ${(P)loop} > zsh: segmentation fault (core dumped) zsh -f And in 51399 on namerefs: > Circular references hidden inside subscripts end up expanding to empty > string, as do command substitutions with the NO_EXEC trick. That surprises me. I can't see any executions occurring. Would making (P) a little safer by applying the NO_EXEC trick to it too fix that seg fault. Or did you have a different fix in mind? Are there sane uses to (P) with nasty stuff like hidden command substitutions. We have (e) and eval which are at least explicit in their dangers. If genuine uses surface later (PP) could turn on the dangerous form. Or you might argue that we should support (PP) for the safe form. Making (P) safer could be another use for the FUTURE option I suggested in the final paragraph of 51281 - perhaps very few people (if any) were still reading at that point so it may have been overlooked. Oliver