Bug 1461483 - history-isearch pattern issue (upstream patch in existence)
Summary: history-isearch pattern issue (upstream patch in existence)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: zsh
Version: 26
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-14 14:53 UTC by Simon Hollingshead
Modified: 2017-06-16 13:20 UTC (History)
6 users (show)

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:
Clone Of:
Environment:
Last Closed: 2017-06-16 13:20:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Simon Hollingshead 2017-06-14 14:53:58 UTC
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 15:00:16 UTC
> 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 21:00:51 UTC
Thanks for the report!  I will backport the fix from upstream.

Comment 3 Fedora Update System 2017-06-14 22:04:31 UTC
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 12:35:52 UTC
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 14:01:18 UTC
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 21:07:40 UTC
Perfect.  Thank you for testing the update!

Comment 7 Fedora Update System 2017-06-16 13:20:59 UTC
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.