Skip to content

Fix simplifier visit budget exhaustion - #659

Open
srkyn wants to merge 1 commit into
google:mainfrom
srkyn:security/re2-simplifier-visit-budget
Open

srkyn wants to merge 1 commit into
google:mainfrom
srkyn:security/re2-simplifier-visit-budget

Conversation

@srkyn

@srkyn srkyn commented Sep 10, 2026 •

Copy link
Copy Markdown

Regexp::Walker::Walk() can stop after its visit budget is exhausted, but the simplifier's two ShortVisit() implementations still log DFATAL while unwinding. This aborts fastbuild processes and produces repeated internal error logs in optimized builds.

Remove those stale DFATAL calls and keep the existing unwinding return values. Regexp::Simplify() already detects stopped_early() and returns the existing pattern-too-large error.

Added a regression that exhausts the walk budget and verifies the failure stays nonfatal.

Tested:

  • the focused simplifier regression
  • the surrounding RE2 test targets in fastbuild
  • the same targets with Clang 18 and UBSan

Signed-off-by: David Sarkisyan <david@srkyn.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant