zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: Segmentation fault immediately after 'unset PATH'
Date: Thu, 11 Jul 2019 09:44:32 +0100	[thread overview]
Message-ID: <1562834672.4950.2.camel@samsung.com> (raw)
In-Reply-To: <CAHYJk3Te=EKxLh3Wo0fbFn2awx2d8sc8HwoZihQqwd6mik8svg@mail.gmail.com>

On Wed, 2019-07-10 at 23:52 +0200, Mikael Magnusson wrote:
> On 7/10/19, Shane Squires <shane2squires@gmail.com> wrote:
> > 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
>
> This is the backtrace i get with debugging symbols,
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000004832b8 in unsetparam_pm (pm=0x716a70, altflag=1, exp=1) at
> params.c:3614
> 3614		pm->gsu.s->unsetfn(pm, exp);
> (gdb) bt
> #0  0x00000000004832b8 in unsetparam_pm (pm=0x716a70, altflag=1,
> exp=1) at params.c:3614

The gsu element (get/set/unset handlers) of that parameter element,
which is the special one for path (N.B. not PATH which is linked), are
null.  That shouldn't ever happen, so it's already broken.  Presumably
this is somehow associated with the typeset.

The parameter structure looks otherwise reasonable, except the PM_UNIQUE
flag has gone by this point.  I'm seeing
PM_RESTRICTED|PM_DONTIMPORT|PM_SPECIAL|PM_TIED|PM_ARRAY
all of which make sense.

pws





  reply	other threads:[~2019-07-11  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10 20:55 Shane Squires
2019-07-10 21:52 ` Mikael Magnusson
2019-07-11  8:44   ` Peter Stephenson [this message]
2019-07-11 10:48     ` Peter Stephenson
2019-07-11 10:58       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1562834672.4950.2.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).