-
Notifications
You must be signed in to change notification settings - Fork 138
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
Stray Thread hogging CPU after penetration testing with qualys #341
Comments
Interesting, thanks for the report!!
At this point in the code, there could be further HTTP requests coming in over the same TCP connection. As the first request has not yet been fully read, because the body was never used (and neither read yet), it has to be removed (=skipped) from the incoming connection to - possibly - get to the second request. If skip keeps returning 0, something should be done about this. |
Ah I see that makes sense. However we assume that these threads were burning cpu cycles since for about 2 weeks so something was not working right. I do have no idea however how we could reproduce this behavior probably as apparently not even the qualys abuse reproducible caused this misbehavior |
Just for clarification, are you planning on taking a look at it? I'd try to fix it but I fear I'd break it in some unintuitive way so I'm a bit hesitant :) |
bump |
1 similar comment
bump |
Feel free to reopen, if this is still an issue. |
We have witnessed an odd behavior of membrane at one of our customers after repeated abuse by qualys.
It appears that with a chance of roughly 25%, their test creates a thread in membrane that does never end and eats up one CPU core. After 8 recorded tests, we had 2 stray threads with the following Stacktrace:
We assume that the culprit is the following section in the Body class (in the discard() method)
Which will never exit in case .skip continuously returns "0" (which is clearly possible, regarding both the javadoc of InputStream.skip and the implementation of BufferedInputStream.skip and .fill)
Would it make any sense whatsoever to continue reading once .skip returned 0 or could we define this as a secondary exit parameter? Why are you pro-actively draining the inputstream anyways and don't just close it and let the operating system handle it?
Added: After dumping the heap and analyzing it, we found the following content in the BufferedInputStream's Buffer which clearly shows the involvement of Qualys:
The text was updated successfully, but these errors were encountered: