zsh-workers
 help / color / mirror / code / Atom feed
* Segfault in completion inside a [[]]
@ 2010-12-04 23:26 emotn
  2010-12-05  1:05 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: emotn @ 2010-12-04 23:26 UTC (permalink / raw)
  To: zsh-workers

Hello,

zsh segfaults with the following testcase (also segfaults with fresh
built zsh, 4.3.10 and 4.2.7) in "zsh -f":
- type this line: if [[ -e / ]] { echo }
- put the cursor after the '/'
- press tab

The segfault doesn't happen if there is nothing between '{' and '}'.
If instead we add more arguments inside, zsh will eat up all the CPU.

The last faulty call (before libc) is in complist.c. It rightfully
tries to complete based on the fact it's in a "[[ ]]" but the
"clwords" variable wrongly points at what's inside the "{ }" (a.k.a
{"echo", "}", 0}).
Unfortunately, I don't know enough about zsh source for making it point right.


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

* Re: Segfault in completion inside a [[]]
  2010-12-04 23:26 Segfault in completion inside a [[]] emotn
@ 2010-12-05  1:05 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2010-12-05  1:05 UTC (permalink / raw)
  To: emotn, zsh-workers

On Dec 5, 12:26am, emotn wrote:
} 
} zsh segfaults with the following testcase (also segfaults with fresh
} built zsh, 4.3.10 and 4.2.7) in "zsh -f":
} - type this line: if [[ -e / ]] { echo }
} - put the cursor after the '/'
} - press tab

This works for me without crashing in 4.3.10-dev-2 patchlevel 1.5130,
so it may already have been fixed.


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

end of thread, other threads:[~2010-12-05  1:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-04 23:26 Segfault in completion inside a [[]] emotn
2010-12-05  1:05 ` Bart Schaefer

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