zsh-workers
 help / color / mirror / code / Atom feed
* Segfault in paramsubst() from completion (regression from 5.3.1)
@ 2017-08-28  0:50 Daniel Shahaf
  2017-08-28  0:55 ` Daniel Shahaf
  2017-08-28 17:57 ` Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Shahaf @ 2017-08-28  0:50 UTC (permalink / raw)
  To: zsh-workers

Just found this:

    % autoload compinit
    % compinit
    % _f() { _arguments '1: :_files' '2: :_hosts' ':: : _normal' }
    % compdef _f f 
    % f x y <TAB>
    Process 27225 stopped
    * thread #1: tid = 27225, 0x00000000004cc3ca zsh`paramsubst(l=0x00007fffff800268, n=0x00007fffff800250, str=0x00007fffff7ff6d0, qt=1, pf_flags=4, ret_flags=0x00007fffff7ffcac) + 762 at subst.c:1770, name = 'zsh', stop reason = signal SIGSEGV: invalid address (fault address: 0x7fffff7fed68)
        frame #0: 0x00000000004cc3ca zsh`paramsubst(l=0x00007fffff800268, n=0x00007fffff800250, str=0x00007fffff7ff6d0, qt=1, pf_flags=4, ret_flags=0x00007fffff7ffcac) + 762 at subst.c:1770
       1767	     * these later on, too.
       1768	     */
       1769	    c = *s;
    -> 1770	    if (itype_end(s, IIDENT, 1) == s && *s != '#' && c != Pound &&
       1771		!IS_DASH(c) &&
       1772		c != '!' && c != '$' && c != String && c != Qstring &&
       1773		c != '?' && c != Quest &&
    (lldb) p s 
    (char *) $0 = 0x00007ffff5f171da "curcontext\xffffff9e"
    (lldb) p $0[9]
    (char) $1 = 't'
    (lldb) p $0[10]
    (char) $2 = '\x9e'
    (lldb) p $0[11]
    (char) $3 = '\0'
    (lldb) 

On 5.4.2-dev-0 compiled from git.

In 5.3.1 (Debian package) I just get:

    _tags:comptags:36: nesting level too deep
    _tags:comptags:60: nesting level too deep
    _tags:comptags:67: nesting level too deep


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Segfault in paramsubst() from completion (regression from 5.3.1)
  2017-08-28  0:50 Segfault in paramsubst() from completion (regression from 5.3.1) Daniel Shahaf
@ 2017-08-28  0:55 ` Daniel Shahaf
  2017-08-28 17:57 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Shahaf @ 2017-08-28  0:55 UTC (permalink / raw)
  To: zsh-workers

Daniel Shahaf wrote on Mon, 28 Aug 2017 00:50 +0000:
> Just found this:
> 

Actually, just:

autoload compinit
compinit
compdef _normal f
f <TAB>

segfaults.

>     % autoload compinit
>     % compinit
>     % _f() { _arguments '1: :_files' '2: :_hosts' ':: : _normal' }
>     % compdef _f f 
>     % f x y <TAB>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Segfault in paramsubst() from completion (regression from 5.3.1)
  2017-08-28  0:50 Segfault in paramsubst() from completion (regression from 5.3.1) Daniel Shahaf
  2017-08-28  0:55 ` Daniel Shahaf
@ 2017-08-28 17:57 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2017-08-28 17:57 UTC (permalink / raw)
  To: zsh-workers

On Mon, 28 Aug 2017 00:50:55 +0000
Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> In 5.3.1 (Debian package) I just get:
> 
>     _tags:comptags:36: nesting level too deep
>     _tags:comptags:60: nesting level too deep
>     _tags:comptags:67: nesting level too deep

That's the same problem.  We have no control over whether the system has
enough resources that we hit an arbitrary recursion limit before
there's a crash.

See many, many discussions over the years, including one quite recently,
and another not so many months ago.

Calling _normal recursively is in some cases sensible, in particular
if you've pruned the command line since the first call
(c.f. _precommand), so trying to check for a real problem isn't that easy.

pws


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-28 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28  0:50 Segfault in paramsubst() from completion (regression from 5.3.1) Daniel Shahaf
2017-08-28  0:55 ` Daniel Shahaf
2017-08-28 17:57 ` Peter Stephenson

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).