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=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,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 14927afd for ; Wed, 10 Jul 2019 20:56:26 +0000 (UTC) Received: (qmail 28964 invoked by alias); 10 Jul 2019 20:56:18 -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: 44506 Received: (qmail 13019 invoked by uid 1010); 10 Jul 2019 20:56:18 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f47.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25503. spamassassin: 3.4.2. Clear:RC:0(209.85.166.47):SA:0(-0.7/5.0):. Processed in 2.645097 secs); 10 Jul 2019 20:56:18 -0000 X-Envelope-From: shane2squires@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.166.47 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=W+RGcSXOSNTWd167yrr3BsK/03+k9i2fysuFTstlFUw=; b=VpvvCyb+uhH0hEDFCORCbKdy0hEwKLRvCApNmqZhaEC1XeYQBzGbRF5JhUvjkU08gX wjCcqKIuTOCSzBE2lKpUJZbw4p+TcEdX0THL9P9PwrwMxrE1T3ikjp/gAlpkdPTafqIF grPE3VV6H5Q2rpaOE6nH0djWk/79CSAglCEl2xulQX6ZxYVn17CQgsmvTDzpa2+0hfMr jYdxCKSFMVL24Cyy85mXBBeReht5gf/V0lgQTE5jGOwxYFf7wy175T83HqJ20/FYhZQH cMJsfo2Zb5cF//ECoYEOo0mhLZ0GQlwltfqqdaxEVVh8mva1tobJLVHebHdNuKfqusdD jQjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=W+RGcSXOSNTWd167yrr3BsK/03+k9i2fysuFTstlFUw=; b=thrT8Q1/TEX5cVPwdLmM8W/PE+lp1P/boMM1iu1WUIn2m4vOeEszHyWkASFH+b2lpR 57ipaXCGiqL9SCDe/kkkRHVDL+KLteLl4Hw66jjhQNOwJujOCsm9qmD2sRDl576tK4t1 Re1t3vqfkxHQ5m1ecDicDImiBrkLPB6BXkUMpsn3hkN8zkqaoL4YQqJEVGTtWdTCpJ1Z WtqG9QoBtaxyNzeYoqiNOpEIg3tEGYbVINAZYi3CxLFVtZV2uP1s8aH/xfyQvkhLiyXJ trCTsgqAt0WvjKAycWk3KIHmpKrHBOhKTh68d/KbMR3CsDZs7SJb8Mq1jXL6p96JRr/1 gm3w== X-Gm-Message-State: APjAAAWTYwjWWdrI5dBx1GlTDksuwpkYnxMTUW3OFPw+4XjGxFWPuq7L sXZ2YjMegfdyKGHSlzhMU8X/t5FGuV8wQ57bp5CgkqL5bqM= X-Google-Smtp-Source: APXvYqx/trICOKclaVjuuAAys6+Ldb7VpIBwsTUY3wMk9ocEhPbutIggAMc4iqsOe3eNJZbCGLqiMVVO7/z5d9Bm9CE= X-Received: by 2002:a6b:621a:: with SMTP id f26mr34279iog.127.1562792142519; Wed, 10 Jul 2019 13:55:42 -0700 (PDT) MIME-Version: 1.0 From: Shane Squires Date: Wed, 10 Jul 2019 13:55:31 -0700 Message-ID: Subject: Segmentation fault immediately after 'unset PATH' To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="000000000000833fd3058d59e63c" --000000000000833fd3058d59e63c Content-Type: text/plain; charset="UTF-8" I'm running the most recent version of zsh available on my system (I am not an admin), which is: ------------------ % zsh --version zsh 5.3.1 (x86_64-unknown-linux-gnu) ------------------ The following script, when executed, produces a segmentation fault for me. This is the most minimal example I can construct. ------------------ File run.zsh: ------------------ #! /usr/bin/zsh run() { typeset -U path=( $path ) unset PATH } run ------------------ ------------------ % ./run.zsh [1] 13415 segmentation fault ./run.zsh ------------------ As far as I can tell, the problem has to involve all three elements here: (1) the type of 'path' has to be modified, (2) 'PATH' has to be unset, and (3) this has to happen inside a function. I can imagine that what's going on here is that, for some reason, changing the type of 'path' from inside a function causes it and 'PATH' to fall "out of sync" somehow, and this creates problems when 'PATH' is being unset. But this is extremely vague and speculative, so I won't waste any more time by discussing it. Before anyone lectures me on this, I realize that unsetting 'PATH' is not advisable in general! It is unfortunately unavoidable in my particular case. 'PATH' needs to be unset and then immediately set to a new value, and (because this is being handled in an automated way for many environment variables) I cannot just immediately re-assign its value. I will find another workaround on my end, but I'm reporting this here mainly because it seems to be a genuine bug in zsh. Thanks in advance for looking into this-- Shane --000000000000833fd3058d59e63c--