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

Huge stack consumption (Request of death) #510

Open
tira-misu opened this issue Mar 7, 2022 · 1 comment
Open

Huge stack consumption (Request of death) #510

tira-misu opened this issue Mar 7, 2022 · 1 comment

Comments

@tira-misu
Copy link
Contributor

If you do a request with big header (eg. long authentication token) leads to huge stack consumption. I have seen stack consumption of over 1MB with a authentication token of about 4KB.

So a even bigger token can lead to stack overflow with a single request.

Per default stack size is 8MB in linux. But even this huge stack size can lead to a crash.

@tira-misu
Copy link
Contributor Author

It seams that the usage of regex_match() causes huge stack usage.

eg. the call of regex_match() in ServiceImpl::parse_request_line() uses about 100KB of stack for about 100 byte long request line. If the request line is longer, more stack will be used. I think all regex_match() calls can easily lead to a stack overflow even on a 8MB stack size.

Of cause - regex are cool and easy to use. But it would be great to use a more simple way to parse strings with a estimable stack usage.

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

No branches or pull requests

1 participant