zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: BUG: Zsh crashes
Date: Sat, 14 Jan 2017 20:19:23 +0000	[thread overview]
Message-ID: <20170114201923.51bffa66@ntlworld.com> (raw)
In-Reply-To: <20170114024833.GA26958@fujitsu.shahaf.local2>

On Sat, 14 Jan 2017 02:48:33 +0000
Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> More minimal reproducer:
> 
> % git clone --depth 5 gitn://github.com/robbyrussell/oh-my-zsh.git
> % mkdir d
> % cp */plugins/rust/_rust d 
> % fpath+=($PWD/d) 
> % autoload compinit
> % compinit 
> % rustc --pretty flowgraph==<TAB><TAB>
> 
> This uses the _rust from omz but nothing else from it.

Excellent, just what we need, thanks.

With ZSH_SECURE_FREE this goes wrong with the error message at line 1506
of mem.c.  That comes from a bad free of a parameter.  I'm guessing this
is (a) earlier than the crash, obviously (b) already somewhat later than
the fundamental problem, which is presumably memory related.

Interestingly, even with exactly the same steps I've seen two slightly
different versions:

- the free came from scanendscope for function _normal
- the free came from deleting a hashtable associated with _lastcomp.

and within those the symptoms aren't stable, either.

In both cases it's from a parameter, but it doesn't look like it's a
single particular erroneous parameter that's the problem; I suspect the
original error has come much earlier.  The relationship to the hash
table of a hash parameter could well be just because that has a
particular large memory footprint for the problem to hit.

Normal valgrind didn't show anything helfupl.  Valgrind integration with
heaps with --enble-zsh-valgrind hasn't been working properly for a while
now, but the circumstantial evidence points more to permanent allocation
problem anyway.

The fact that it's the second tab must be relevant in some way.  Some
state may not be being preserved properly.

This is going to take some lateral thinking.  Anyone who can think
laterally might be able to help.  Playing with the completer, for
example.

pws


  reply	other threads:[~2017-01-14 20:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170113174208epcas1p109452434d2f95e52b24e49029ce15943@epcas1p1.samsung.com>
2017-01-13 17:40 ` Bjorn Baron
2017-01-13 17:52   ` Peter Stephenson
2017-01-14  1:09     ` Phil Pennock
2017-01-14  2:48       ` Daniel Shahaf
2017-01-14 20:19         ` Peter Stephenson [this message]
2017-01-14 20:36         ` Peter Stephenson
2017-01-14 22:10           ` Peter Stephenson
2017-01-14 22:12             ` Bart Schaefer
2017-01-15  2:32             ` Daniel Shahaf
2017-01-14  4:08     ` Eric Cook
2017-01-14  4:18       ` Eric Cook

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=20170114201923.51bffa66@ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).