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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6784 invoked from network); 12 Feb 2023 08:35:30 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Feb 2023 08:35:30 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676190930; b=qM/FQvR09d7WEuvUrQoqoZ5oTedp9qxlvgzJBqtztPLly/Xgq4tWEYjNDRasKbuwGw3UmTpVJI iV0wUt+5F64SVg6IwN+JilvpID26y+D8DF9rdBqVF1vkI8EppjlBNBevBXRecO8X9/vFr9A9/2 1fyU/nFqqQr5LRtoEjHJEM2O8+MeoeUkSlbiiQlJ4Xm3MJXxF4Y4PN4nmbtQXlpWlsbl1CwNuP aa5bW9knldhFZwlyckm5gjrPlx2IxklpcPbV/Iml7tiS8ENfpFkcFIoIPR8J7B2HSF08XK9ktN jQSd2E1nQuYORj+26MGF+ExKYAlmsTt5EcwSsTarSNGsaQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f54.google.com) smtp.remote-ip=209.85.218.54; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 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-20210803; t=1676190930; bh=i7Qz5sujvtM9DBNgA7EILizOQ+TzoWBeAX5PIcbVkfw=; 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=fHrhh7Zz8lIhsDNS7lb9TyK35A62YSpI+oSALWYURi6zLtCRJWc7BsOmn7JB9MqjFaE1GFo/S/ jMPFiUMb5yzc+2hlTg/zHVgFiXAL7uAceKV0S3gniEH9yPPNFPVEKJ6owXnYcURCPeOIKMe+vI x+i3dvnmroQcDi6KbrdcOdmCObw18ENreisBhkPXzGLAdn9LXt/uXyMMGGuSBe30ySdqiYJ0nv ia9Z+uMlK95qS1fjOAMSLCVa+dI/tYZuwdpuckfSKN/+ED9TjMn1j2g3UBq8kPlb8dYCYKfBFf oXxAYCBkvJPXq5ihu/SBsFoUE0BV/A3ixwB1Gr+fWyQBAA==; 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-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=LOr/V/vIzoXT65VXQa5cW1sU3Ym3ZNUeneIXR1rP2GU=; b=sYxWkZ+aOAKvaHC4UghWXHivNT YPcCoqFKJCTGRx0WGpYWSpG/UYfKbqHCJwxkpDZH1U2i9VwTQiAPY/VJjcbmZSUVq4ttOCWsSPBUN ipyaXpLOykzWR3jsuA4oiZ373jORKtk41SFU62EoP9NAdcZ7kaaxLx/1T6/PMX6rlxadCxglJhKPo jz6BSn9bdTnk2X171tkibdT3Wy2R/2FeDzefRujLxnyAW2U9drOQT6KjMTsh1IfT2ol8oQTdVMbOZ rQB5dQ5UaX4mkA6Us9Y/aGbaGzaGMOt8nkOuYq30O9XitdkRkCyVtMgjKIg9/CdX1Xhyqbxk6o82f mJVD0soQ==; Received: by zero.zsh.org with local id 1pR7pZ-000JM2-VE; Sun, 12 Feb 2023 08:35:29 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f54.google.com) smtp.remote-ip=209.85.218.54; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f54.google.com ([209.85.218.54]:40620) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pR7os-000Ijw-3V; Sun, 12 Feb 2023 08:34:47 +0000 Received: by mail-ej1-f54.google.com with SMTP id rp23so25193823ejb.7 for ; Sun, 12 Feb 2023 00:34:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=LOr/V/vIzoXT65VXQa5cW1sU3Ym3ZNUeneIXR1rP2GU=; b=D46yz5XZG6kCRFTDjynNXhzpF5klFVXzy9UtYrl6YX9QUAASxY5YH4T9qQXl7xQIpX +6LgeBjP+Zc8H6tRrUcPtERHdILWk/RpYgEQ3WhHx/mKmNWTaHgU7ALvOstqgQrWF0uY xB4rAnwrSjnTJOwJAN9HXb4JwHq8RhVe30r3k0MVQPNOVWhVlI+7n1UmTBuF3ZW4jSf7 UMty/rhJZLMDokpYnJWV9T+7BXfKnc0++poOTYEhG/09+W/Z6gfVe9LQdFObNWQblG4Z zJZO3BDaSiBV4YVieAf7HYASuJmu6vmZAudeFeHIIysnk2R9G/ksYC02I07LQpbj4GW5 2Mmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LOr/V/vIzoXT65VXQa5cW1sU3Ym3ZNUeneIXR1rP2GU=; b=lslxnUZYRtYAnNAb/gRKN9yFFod3BuIgOM8U7vMRF4wZfw6wXgpAoEtzqW5Hh10YhP EC8xWGoqBQBNDCAvlRVNxek77l2HTgwIMOu6/PFVLG3ZpN/SmeMFAKJp/BxCu+Wt6R5V jOOupFHQI8NFJcu5goJXHwIphn/n2818bSSrtCWDF2zfny3X8Wr8GrfamlpAAGY5llUh cMaW2iNHFZYIZhmMqkOgkOqBf4UC5CaGpZnHHOMuPQYgO8Bigkwx6vAEMh1Axaa9ZOvX /x626ZfghHJS/z35xMY8dh6Hr0cQL9DJWP6CXieh9vzuLxM0gJ4KN5CYVz3NgaDSjHZ4 hxTg== X-Gm-Message-State: AO0yUKV0L9HMhEeLAVWv4EWqKJWP+J6u0QpZJgVj4QmnpzCxN7M/81Sr RMqJecAbZ8/4KtI8FUJLHLIdWNW7SENgYGZtvksf8o+XmaNT6bpC X-Google-Smtp-Source: AK7set/JDN7WzBMgJBAaRYooIn3N04+n/CwUKgCl9DVT3tFlgfd80JiGFC+jEQAWNDX2lIzX5VpUgo32gOK22/ODz1s= X-Received: by 2002:a17:907:2cd3:b0:889:c0c7:f503 with SMTP id hg19-20020a1709072cd300b00889c0c7f503mr3054014ejc.6.1676190885809; Sun, 12 Feb 2023 00:34:45 -0800 (PST) MIME-Version: 1.0 References: <67689-1675827940.088548@BxvG.D9_b.7RzI> <12608-1675903622.800470@Xj82.e3y1.svhG> <66045-1675975796.128039@FBF_.0yMO.Y8fk> <91776-1676188804.595308@S3xK.VfOi.LVPX> In-Reply-To: <91776-1676188804.595308@S3xK.VfOi.LVPX> From: Bart Schaefer Date: Sun, 12 Feb 2023 00:34:34 -0800 Message-ID: Subject: Re: Speaking of dangerous referents To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51408 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, Feb 12, 2023 at 12:00 AM Oliver Kiddle wrote: > > 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. I apologize, the reference to NO_EXEC only applies to the clause about command substitutions. The circular references are handled by using tagging to detect/abort the loop during nameref resolution. I'm uncertain whether a similar approach could be used for (P) and haven't dug into it, I didn't want to mix a patch for that into the patches for namerefs. > 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? It wouldn't and I didn't, at least not yet. It would have to be something along the lines of the "math recursion limit exceeded" handling. There are two or three other places in the code where there are comments rejecting arbitrary limits on recursion so this might be something we don't want to fix. > 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. It would be helpful to know whether any of the uses of (P) in the existing contributed and completion functions etc. actually rely on expanding command substitutions. It would be pretty unlikely that they rely on self-reference.