-
Notifications
You must be signed in to change notification settings - Fork 3k
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
{case_clause,[]} in ssl_gen_statem:iovec_from_front/4 #7507
Comments
thanks for report.
|
Checked on 25.0.4 again and also on a few versions between 25.0.4-25.3.2.3. Issue is reproduced. But after changing the https resource for requests the issue is gone. Seems resource related. |
This function will only be called for handling application data, so the possible handshake related data should not factor in. At the moment I have no explanation for why this could happen. Do you know if the resource causing the trouble possible send empty application data packets? This is allowed for application data and is a corner case which might factor in. |
It is a bug. The comment in the code is meant to motivate why it uses an explicit match for a list of size 1 instead of using a last clause for all lists shorter than 2, because that causes an infinite loop if the user of the queue tries to remove more data from the queue than is queued. And an infinite loop is much harder to debug than a case clause. Nevertheless, the code that uses the queue has failed to track how many bytes that are queued, and tries do dequeue more than is queued. I see no obvious bug with zero sized packets. They could introduce empty binaries in the queue, but the code seems to handle that. Zero sized packets are probably less common and therefore less tested, though... |
So can you show us a way to reproduce this bug? |
Regarding the end of your log error entry: ... That should originate from a How does |
The line numbers in your log error entry doesn't quite match the line numbers for OTP-25.3.2.3. |
My bad. There is no check on So: it seems Can you (@AnufrievDE) somehow confirm that this is what is happening e.g by tracing on |
Hello, There were no patches applied to OTP, I'am not sure why line numbers differs, in first report. But I see issue reproduced regularly on otp 25.3.2.3, erts 13.2.2.2, there is today's part of stacktrace (with correct line numbers, matches sources from maint-25 branch):
I can collect some debug traces to share, if you know where it would be helpfull to enable it. |
Sorry for the confusion. Currently I can see issue on otp 25.0.4 as well as on 25.3.2.3. Just for some reasons (some changes in my application, probably additional requests added, I'll check it...), this issue began to appear and it coincided with the OTP uplift. |
Yes. That stack trace fits like a trucker hat on OTP-25.3.2.3. It also shows that a passive recv with length -1 has been called, which should be forbidden in the API since it breaks the internal buffer handling... If you can find out if that actually is what happens ( |
There is traces from ssl:recv/3. It is called with Length = -1.
|
Can you add caller info to that trace and see from where that call is made? |
dbg:tpl(ssl, recv, 3, cx):
|
Seems like a bug i Hackney, then, since it is called from I will create a pull request to make this a function clause in |
…o maint * raimo/ssl/non_neg_integer-length/GH-7507/OTP-18700: Guard against negative Length
…o maint * raimo/ssl/non_neg_integer-length/GH-7507/OTP-18700: Guard against negative Length
Strange..., this issue did not auto close when I merged PR #7526. |
I found that the only safe way to always get it closed is to include the close/solved comment in the commit message. |
I saw now that a closing keyword is stated to only work on the default branch, which should be 'master' in this repo, not 'maint'... |
…o maint-25 * raimo/ssl/non_neg_integer-length/GH-7507/OTP-18700: Guard against negative Length
facing same issue, don't know how much there are related edgurgel/httpoison#485 |
Hello, I've an application that perform http get requests with hackney use. And after uplifting to OTP-25.3.2.3 (erts-13.2.2.2), the following error, which seems not preventing the main application workflow, started to appear from time to time in the logs:
Describe the bug
I am not sure this is a bug, because this missing case clause, seems expected, according to the code. But as I understood, this crash is happend at establishing tls_connection, after receiving some (handshake related?) data from the resource. Maybe this data is bad? Would you suggest why this crash happen?
To Reproduce
I have no exact scenario to reproduce, unfortunately. Just doing get https requests for specific resource, for example.
Expected behavior
No crashes expected. I don't see any crashes at the same circumstates on otp 25.0.4 (erts-13.1.2).
Affected versions
OTP 25.3.2.3 (erts-13.2.2.2)
The text was updated successfully, but these errors were encountered: