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
bytes_transferred > 0 assertion fails #1373
Comments
Investigating... |
No. But I guess I can add configurable setting which will invoke the completion handler with an error instead of asserting? You could opt-in to it as a workaround. |
That would be great! |
We think that this is very likely a bug in Asio for not handling If you could apply this patch, uncomment the line which logs to cerr, and adjust the line so it logs to wherever/however you log in your program, then it would be very helpful for us to know what the log output is if the problem happens again. It is possible you won't see the log line (or the assert in beast) because of the handling of |
Thank you for the update! I have also investigated a little bit. I think the error only happens when I |
Did you try my patch? |
I have installed it, waiting for the error to occur now. |
The suspense is killing me |
Me too. It seems like a tough bug always disappears when you are trying to track it down .. :) I am logging |
The error happened now, however I only got the assert output from sterr which I posted in my question above ( |
What did |
It didn't print anything, I only got the assertion message from stderr. |
Hmm, but you did uncomment this line right?
vinniefalco/boost.asio@89feb2a#diff-9693888572396784daf4f0aded26ce3aR286 |
Yes I did, then I rebuilt boost and my application. |
Well that makes no sense at all.. in that asio file on line 287 is the only way that the function can return with the error cleared but if there's no output it means the |
We need more info. Please try editing that |
Dereferencing Is there a better place where I could check for |
|
The application just crashed, this is the output:
The second line was printed directly before the output. The first line seems to be older. |
Fix boostorg/beast#807 Fix boostorg/beast#1373 This resolves an issue where an ssl::stream read operation returns a successful error code but zero bytes transferred, violating its contract. * Treat SSL_ERROR_ZERO_RETURN as EOF * Use the ssl category for sys_error * On error, if sys_error is 0 (success), return ssl::errors::read_sys_error instead.
Fix boostorg/beast#807 Fix boostorg/beast#1373 This resolves an issue where an ssl::stream read operation returns a successful error code but zero bytes transferred, violating its contract. * Treat SSL_ERROR_ZERO_RETURN as EOF * Use the ssl category for sys_error * On error, if sys_error is 0 (success), return ssl::errors::read_sys_error instead.
Any update? |
Seems to be running fine so far! |
I'll go ahead and close this, the pull request to fix asio is here: |
I am basically having the exactly same problem as described here: Assertion failed: (bytes_transferred > 0).
I am using a
websocket::stream<ssl::stream<tcp::socket>>
to connect to a ws server. After some time (can be minutes, hours or even days) thebytes_transferred > 0
assertion fails:#2 0x00007ffff398139a in __assert_fail_base (fmt=0x7ffff3b087d8 "%s%s%s:%u: %s%sAssertion %s' failed.\n%n", assertion=assertion@entry=0x555557004919 "bytes_transferred > 0", file=file@entry=0x5555570047a8 "/usr/local/include/boost/beast/websocket/impl/read.ipp", line=line@entry=496
I can also post the full gdb stack trace if that would help.
Are there any updates regarding this bug/problem?
Thanks in advance!
Boost Version: 1.69
Asio Version: 1.12.1
Beast Version: 186
gcc (Ubuntu 8.2.0-1ubuntu2~18.04) 8.2.0
The text was updated successfully, but these errors were encountered: