-
Notifications
You must be signed in to change notification settings - Fork 412
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
Debug panic in packet assembler #261
Comments
This is interesting. The logic in |
That's a good idea - or I try to reproduce this in a test case. What do you think would happen in a release compile? |
I have no idea, but probably data loss--this assert is there for a good reason. We actually might want to elevate it to |
The while loop can be left if |
I don't actually know! I wrote this code a while ago and I don't remember the exact rationale for that condition. How about adding a fuzzer-based test that generates and feeds the assembler random data ranges and sees what happens? That should discover a reduced test case for the crash very rapidly. |
I'm new to reading it as well and reported this here in case others also observe it. By reading quickly, I'm very suspicious about this part because it can explain why suddenly the 1-length packet was not dropped anymore:
The |
Excellent catch! Can you write a testcase? |
I'll have to dive into it a bit more, then yes ;) |
The current hole was always shrinked even if the packet assembler rejected adding a packet due to not being able to insert a new hole. Shrink only after a new hole was added. Shrinking before or after does not make a difference because offset + size < hole_size and thus contigs[index] is not empty, passing the debug_assert in add_contig_at. smoltcp-rs#261
The current hole was always shrinked even if the packet assembler rejected adding a packet due to not being able to insert a new hole. Shrink only after a new hole was added. Shrinking before or after does not make a difference because offset + size < hole_size and thus contigs[index] is not empty, passing the debug_assert in add_contig_at. #261 Closes: #265 Approved by: whitequark
In debug mode I got a panic if the packet assembler is overwhelmed for long time with 1 byte sends and probably misses to reject it due to an overflow or similar? (Even though I have no idea how the sender got into sending only single bytes – maybe it isn't related to the panic and it works with multiple of bytes, too. Edit: Ah, the silly window syndrome.).
The text was updated successfully, but these errors were encountered: