Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Segmentation fault immediately after 'unset PATH'
- X-seq: zsh-workers 44506
- From: Shane Squires <shane2squires@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Segmentation fault immediately after 'unset PATH'
- Date: Wed, 10 Jul 2019 13:55:31 -0700
- 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==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author