Uh oh!
There was an error while loading. Please reload this page.
[Fix](func) Keep multi-match regex cache owner alive - #66909
Merged
Conversation
hello-stephen
commented
Aug 18, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
linrrzqqq
commented
Aug 19, 2026
CollaboratorAuthor
run buildall |
| static Status prepare_regexps_and_scratch( | ||
| const std::vector<StringRef>& needles, | ||
| multiregexps::DeferredConstructedRegexpsPtr& deferred_constructed_regexps, | ||
| multiregexps::Regexps*& regexps, multiregexps::ScratchPtr& smart_scratch) { |
linrrzqqqforce-pushed
the
fix-multi-match-any-UAF
branch
from
August 19, 2026 05:14
68dc839 to
cd09c06CompareContributor
PR approved by at least one committer and no changes requested. |
Contributor
PR approved by anyone and no changes requested. |
HappenLee
commented
Aug 19, 2026
Contributor
run buildall |
1 similar comment
linrrzqqq
commented
Aug 20, 2026
CollaboratorAuthor
run buildall |
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: The multi-string search unit test included the production .cpp file directly. This violates build hygiene and can cause duplicate strong symbols in unity builds. Move the testable implementation template into a header shared by production code and the unit test. ### Release note None ### Check List (For Author) - Test: Unit Test - ./run-be-ut.sh --run --filter=FunctionsMultiStringSearchTest.* -j50 --coverage - ./build.sh --be - build-support/check-format.sh - build-support/run-clang-tidy.sh for the modified production and test translation units - Behavior changed: No - Does this need documentation: No
linrrzqqq
commented
Aug 20, 2026
CollaboratorAuthor
run buildall |
hello-stephen
commented
Aug 20, 2026
Contributor
TPC-H: Total hot run time: 17476 ms |
hello-stephen
commented
Aug 20, 2026
Contributor
TPC-DS: Total hot run time: 83383 ms |
hello-stephen
commented
Aug 20, 2026
Contributor
ClickBench: Total hot run time: 14.57 s |
jacktengg
approved these changes
Aug 21, 2026
Uh oh!
There was an error while loading. Please reload this page.
Contributor
PR approved by at least one committer and no changes requested. |
yiguolei pushed a commit
that referenced
this pull request
Aug 24, 2026
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 freeto 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.
What problem does this PR solve?
Problem Summary:
multi_match_anycompiles each pattern array and stores the result in a process-wide, direct-mapped cache.The previous implementation retained the cache entry's shared_ptr only while preparing the regex database and scratch space. The subsequent scan used a raw
Regexps*. If another concurrent request inserted a different pattern array into the same cache bucket, the old cache entry could be replaced and destroyed while it was still being scanned, resulting in a use-after-free.This change keeps the cache entry's shared_ptr alive for the entire hs_scan operation. Cache eviction can still replace the global entry, but the compiled database is not destroyed until all active scans have completed.
Release note
Fix a potential use-after-free in multi_match_any when concurrent pattern arrays collide in the compiled-regex cache.