-
Notifications
You must be signed in to change notification settings - Fork 30
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
CRASH in version 1.4.1 #46
Comments
I did some tests and I think the reason for this crash is when I rewrite a sync packet exceeding the original length. I managed to reproduce the same errors in the log. I use BS_SetWriteOffset with 280 bits to change only health / armor in the onfoot sync. Some player probably sent an invalid packet (smaller than expected), so I would be writing to a part of the packet that doesn't exist. It also occurs with BS_WriteOnFootSync, BS_WriteInCarSync, etc. |
Attach full server_log.txt and example.pwn (to reproduce the error), please. |
I guess you need to delete "BS_SetWriteOffset(bs, 0)" or "BS_ResetWritePointer(bs)" calls (if existing). |
I don't know how to simulate an invalid packet, so I tested it this way:
This will crash the server. Edit: this code, without BS_ResetWritePointer, crashes in Windows, but not on Linux. Deleting BS_ResetWritePointer really prevents crash on Linux. I'm using BS_ResetWritePointer in my code, but what I did to fix it was to check the size of the packet before writing it. server_log.txt (Linux):
|
|
My old code:
|
Function BS_ResetWritePointer empties BitStream data. No reason to use it after BS_WriteValue, it is nonsense. I think it is a cause of the issue.
Are you sure? |
Yes, I've tested again this code on Windows.
|
you confuse something, max for this packet is 456, not 552 |
Code from plugin include:
|
You are right, I forgot data[PR_surfingOffsets] |
Hello,
I was using version 1.3.0 of the plugin, and I have never had a server crash problem for years. However, when I upgraded to version 1.4.1, crashes started happening randomly, once every 1-3 days.
server_log.txt:
The text was updated successfully, but these errors were encountered: