Repository navigation
Cherry pick #126120 to 26.7: Fix out-of-bounds accesses in the replxx line editor - #126616
Merged
Merged
Conversation
Update `replxx` with four fixes: - An incremental history search (Ctrl-S, Ctrl-T, Meta-R, and Ctrl-R in the web terminal and SSH sessions) that started on a recalled and then edited history line mapped the cursor of the edited line onto the old text of the entry, so a search that found nothing left the cursor past the end of the line. The next edit wrote out of bounds and aborted `clickhouse-client`/`clickhouse-local`; through the web terminal or an SSH PTY session, which run the editor inside the server, it aborted the server. - Ctrl-W and Meta-. passed `char32_t` code points to `isspace`, which is undefined for values above 255 and crashed on e.g. U+10FFFF. - A tab renders as 4 spaces, but the prompt was rendered in place, so a search prompt with a tab (Meta-R on a line with a tab) overflowed its buffer. - The prompt's last line position was the number of characters minus the cursor column, which is negative for a prompt with a double-width character (e.g. in the server's `display_name`), so leaving a history search read before the prompt text and aborted. The commits are on top of the current pointer, as the broader `replxx` update goes into a separate PR. Closes #126008 Co-Authored-By: Claude Opus 5.5 <[email protected]>
ClickHouse/replxx#50 is merged into `master` of `replxx`, and the copy of the same fixes on top of the previous pointer (ClickHouse/replxx#51) is closed. Point the submodule to the merge commit. This also brings the `master` changes that were not in the previous pointer: editing modes, `Esc` delay, prompt indentation, per-terminal state and the Meta+Up fix (ClickHouse/replxx#36, #43, #44, #45, #46, #47, #48). `04909_client_hints_history_navigation`, which the `Esc` delay broke before #48, passes 10/10 locally. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moving `contrib/replxx` to `replxx` master brought in a regression from the `Esc` delay support: `read_unicode_character` called `read` only when `poll` reported `POLLIN`, so on `POLLHUP`, `POLLERR`, or `POLLNVAL` alone the uninitialized character was decoded as input. The pointer now goes to the merge of `replxx` master into the branch of ClickHouse/replxx#49, which calls `read` on any event (end of input or error ends the input, as before), and also re-reads the terminal width on refresh for embedded clients that do not receive `SIGWINCH`. Addresses review: #126120 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
ClickHouse/replxx#49 is merged into `master` of `replxx`. Point the submodule to the merge commit; its tree is the same as the head of the #49 branch used before, so the code does not change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rsor Fix out-of-bounds accesses in the replxx line editor
Collaborator
|
The only conflict is the The
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original pull-request #126120
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job