Skip to content
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

Fix range parser when parsing too many ranges #1812

Merged
merged 2 commits into from
Apr 7, 2024

Conversation

jimmy-park
Copy link
Contributor

Stack overflow is detected by AddressSanitizer on MSVC when parsing too many ranges using std::regex.
ServerTest.GetStreamedWithTooManyRanges has failed due to this reason.
I would like to suggest a range parser with plain string manipulations rather than relying on std::regex.
And some test cases are added for invalid ranges not covered by the current implementation.

@yhirose
Copy link
Owner

yhirose commented Apr 6, 2024

@jimmy-park thanks for the fix. Could you check the performance difference between the regex implementation and the new implementation? I believe the new one should outperform the regex one, but I would like to confirm it before merge the pull request. Thanks!

@jimmy-park
Copy link
Contributor Author

Here is a simple benchmark result.
https://quick-bench.com/q/baC_7m3nbxFySBpi5kTcGYfr2j0

@yhirose
Copy link
Owner

yhirose commented Apr 7, 2024

@jimmy-park great job!

@yhirose yhirose merged commit f44ab9b into yhirose:master Apr 7, 2024
4 checks passed
@jimmy-park jimmy-park deleted the fix-range-parser branch April 7, 2024 14:08
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.

2 participants