-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug: UInt64 maybe negativ #72
Comments
Yeah a |
@szuniverse where you able to verify with the size of |
Unfortunately in the last few weeks I couldn't working on my project. So I will write more details If I will have enough time |
OK sounds good. I will go ahead and close this issue out until then. Just reopen it when you are ready. |
@daltoniam |
@wispur thanks for the report. If you get any details on a consistent way to reproduce this, let me know and I will look into it. |
@daltoniam Thanks for the reply too! I am also trying to reproduce this issue reliably, so far this issue just pops randomly when I do not expect it to happen :( |
Hi. Last past days I tried to reproduce this bug on a consistent way but I cant.. Its seems randomly, but its a real bug, which is always crashes the app [ And one more thing... In this weekend my router has been broken, and I have to use an older router more than 7years old. And this bug appears more frequently, so I think it depends on the router. But I am not sure, this is my experience.. ] |
If I knew what was causing the crash, I would just fix it 😄. It isn't something that can just be handled and not crash, we have to track down a cause and hopefully a fix. My working theory is that a huge packet is coming through, but is fragmented just right, so we can't read the expect length of the packet. I am going to try adding that protection logic and see if it resolves the issue. I will try to do that in the next few days, but no promises as it has been a busy last few weeks. |
@szuniverse try adding this at line 499 (right below the dataLength checkers): if bufferLen < offset {
fragBuffer = NSData(bytes: buffer, length: bufferLen)
return
} |
Okey. thanks a lot! I will "test" it, I hope the crash will dissapear without side effect :) |
Yes I will, hoping it works 😄 . Let me know if it fixes and I will add it into the official release. |
Well, It works fine. The runtime crash has been resolved, but give me one week to test it. I will write you soon. |
Great to hear. If all goes well, we can run it threw the autobahn tests again and cut a new version! |
Okey. I tested it on this weekend and everything works fine. The crash has been resolved :) |
Awesome! I will try and run the test some time this week and cut the new version. |
Hi! Do you merged this bug fix to the master? |
I did, master should have all the fixes. Haven't create the new tag yet, was finishing the final touches on an autobahn test/example before creating the 0.9.4 tag. |
Awesome! :) |
Hi.
Very often get a runtime error on the latest version.
This is around the 500. row:
var len = dataLength
if dataLength > UInt64(bufferLen) {
len = UInt64(bufferLen-offset) // runtime error position
}
the bufferLen value is 8, and the offset value is 10. I dont know how it happens but it will be negativ..
Unfortunately I didnt implement the server so I cannot check it. maybe it would be a good way to handle this case in this library.
The text was updated successfully, but these errors were encountered: