-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
re2 error: re2/re2.cc:772: DFA out of memory: pattern length 102, program size 928, list count 352, bytemap range 35
#2739
Comments
Maybe providing an option for users to pick which regex engine they want, re2 or default, would be worthwhile since re2 is a drop-in replacement of |
It couldn't hurt given #2354. I think this specific error is caused by the configured trufflehog/pkg/gitparse/gitparse.go Lines 27 to 28 in 2888f8c
|
The whole diff is never scanned, we use a sliding-window-with-overlap chunker to break up data into more manageable chunks: trufflehog/pkg/sources/chunker.go Lines 13 to 18 in 333c4f5
Looks like the default max_mem is 8MB, so i'm guessing we have an expensive regex on some data? |
Unfortunately, this seems to be a transient error. I've attempted to re-scan orgs/repos where I encountered it but haven't been able to reproduce it (so far). It might be possible for https://github.com/google/re2/blob/b7e96b34c0945fccb8b5282404f82c7ab0843717/re2/re2.cc#L772-L777 |
Please review the Community Note before submitting
TruffleHog Version
Trace Output
Expected Behavior
The chunk data should be scanned.
Actual Behavior
TruffleHog outputs the aforementioned error from re2, making it unclear what the cause is and whether certain chunks were skipped.
Steps to Reproduce
The error seems semi-random so it's difficult to reproduce. Additionally, the log comes directly from
re2.cc
, meaning there is no context associated with it.Environment
Additional Context
google/re2#186
References
The text was updated successfully, but these errors were encountered: