Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Segfault completing find -exec (since 54889?)
- X-seq: zsh-workers 55208
- From: Han Boetes <hboetes@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Segfault completing find -exec (since 54889?)
- Date: Sun, 11 Oct 2026 22:23:30 +0200
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=JJ+tjY9ZmuUaPW3+ycZPEyZ8r5QWAHcS7HS2C6KBnBQ=; fh=SbTlPuNNxBzTkRlwWtqw/TXBY0HvGvtE97RpPp3sJPM=; b=FZMT60K1vbU+XT9IrYV7bL36P95W8MR+lRKuozofXt4wEAHtAr1O9F+22SjA9Lm8YG DHHx6YLbIPqPcJH7KSzvlAMU/2RS+wBiJffqydtyxPYLkUH0JgFCZWxiiIC9uIq2mPX5 7GLX6t2HI6dS5ZdsfIOI1YPoYDoivjgi+lbCs2vZdwPStLZWTHprDhNr6KQdvkiK8I12 2e/p8nvYzWUxdRQtc+z3XV4u6GQWr+DntHoaO9hu6oe0CKinnw00hq/vKHM/wM5bw7rF /Oc4OyvSmBUbCBO7Gytf09Pntx00wFbk8mipQfwWCUKIKmmwNzdBbAN7tW4aF7Cv0wSc Yfwg==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1791750223; cv=none; d=google.com; s=arc-20260327; b=GQBqeLZIOFpS5YiORPlv5te1wM0d8kb6U5il10IzIOZMwLk5gz6PehdtLd7feb2ZOt 8wA+QQSxjQBuZmbNHUcJUdPzVwyN8K+AIAWJGC89gILqS0E36BWqi8zxFFZE8e1s66Kz fcpRrhhvN6JgJmp5xEC62ADw88r55eUNXcZKSBaiUBBzrezSE+Lgp87S3cGQJ5Br/onZ vFrRbQY4dOw4Hbe9oTBHilI9CBQSx72VgjrXnhzOoUiesG6soMsMKbKTtfeMHFe9iufy 49aNa+3bov7Lun6l1xvSARvxpAFSAfLSwxV5SIfsQ9j8cnGTcZzcDW/ZToFP66il+8jk 3cGg==
- Archived-at: <https://zsh.org/workers/55208>
- List-id: <zsh-workers.zsh.org>
Hi,
I'm running current master (5.9.999.3-test) and hit a segfault in completion. Easy to reproduce:
zsh -f
autoload -Uz compinit; compinit
find . -exec '{}' <TAB>
The shell dies with SIGSEGV. Backtrace from a -g -O0 build:
#0 pattryrefs (prog=0x0, string="", ...) at pattern.c:2306
#1 pattry (prog=0x0, string="") at pattern.c:2230
#2 ca_parse_line (...) at computil.c:2148
#3 bin_comparguments (...) at computil.c:2676
So pattry() gets called with endpat == NULL.
I think this comes from 54889 (7a43a20cd), which added a "goto cont" after
} else if ((state.def = state.def->next)) {
That jump skips the patcompile() of state.def->end at the bottom of the loop. _find's -exec spec has one normal argument followed by a rest argument with an end pattern (*(\;|+)), so after the program word, state.def points at a definition with ->end set while endpat was never compiled. The next word then crashes at line 2148.
Reverting just that goto makes the crash go away here. I haven't looked into what the right fix is without undoing what 54889 was meant to do.
I'm not subscribed, so please Cc me on replies.
Cheers,
Han
Messages sorted by:
Reverse Date,
Date,
Thread,
Author