Bug 1461483 - history-isearch pattern issue (upstream patch in existence)
history-isearch pattern issue (upstream patch in existence)
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: zsh (Show other bugs)
26
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Kamil Dudka
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-14 10:53 EDT by Simon Hollingshead
Modified: 2017-06-16 09:20 EDT (History)
6 users (show)

See Also:
Fixed In Version: zsh-5.3.1-9.fc27 zsh-5.3.1-6.fc26
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-06-16 09:20:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Simon Hollingshead 2017-06-14 10:53:58 EDT
There is a known issue in ZSH, specifically versions up to and including 5.3.1, where a static pattern buffer is used in the history isearch.  However, the assumptions that led to this code forget that ZLE hooks may call other pattern functions as well, breaking functionality.

As an example, this issue breaks certain uses of zsh-syntax-highlighting (https://github.com/zsh-users/zsh-syntax-highlighting/issues/407)

A backported fix has been applied by both Arch Linux (https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/zsh&id=0e7db42263c914ae4c7b3c74df1e6c756c94fe8b) and Debian Stretch (https://anonscm.debian.org/cgit/collab-maint/zsh.git/diff/debian/patches/cherry-pick_48cadf48_be_more_careful_with_pattern_allocation_in_history_isearch.patch?id=348c47bdc3b6a92558d82086d168e7829437388a)

Both of these come from the original patch shown here: http://www.zsh.org/mla/workers/2017/msg00034.html / https://github.com/zsh-users/zsh/commit/48cadf48ff9c61ce09e826ad9a58e250e999a262

I am hoping that Fedora would also be willing to provide the same backported fix.

Version-Release number of selected component (if applicable):
zsh-5.3.1-5.fc26-x86_64

Steps to Reproduce:
% bindkey '^R' history-incremental-pattern-search-backward
% evil_hook() { a=(); : ${a[(r)foo*]}; };
% zle -N zle-isearch-update evil_hook
% echo "foo"
% echo "bar"
% echo "baz"

type: <^R>b
% echo "baz"
bck-i-search: b_

type: <^R>
% echo "foo"
bck-i-search: b_

'foo' is found instead of 'bar' because evil_hook modified the static pattern used in isearch.
Comment 1 Simon Hollingshead 2017-06-14 11:00:16 EDT
> specifically versions up to and including 5.3.1

I missed a word.  Specifically 5.3.x versions up to and including 5.3.1.

There is no indication of a similar bug in the 5.2 releases (such as those available on fc25).
Comment 2 Kamil Dudka 2017-06-14 17:00:51 EDT
Thanks for the report!  I will backport the fix from upstream.
Comment 3 Fedora Update System 2017-06-14 18:04:31 EDT
zsh-5.3.1-6.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-559b37e4fb
Comment 4 Simon Hollingshead 2017-06-15 08:35:52 EDT
Appreciated!  Looks like the fix has worked to me, but right now POSTs to Bodhi seem to be timing out.  I'll try again later to get that sweet karma up.
Comment 5 Fedora Update System 2017-06-15 10:01:18 EDT
zsh-5.3.1-6.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-559b37e4fb
Comment 6 Kamil Dudka 2017-06-15 17:07:40 EDT
Perfect.  Thank you for testing the update!
Comment 7 Fedora Update System 2017-06-16 09:20:59 EDT
zsh-5.3.1-6.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.