Skip to content
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

core/packet.lua: Enable overflow check when allocating packets #884

Merged
merged 1 commit into from
May 12, 2016

Conversation

lukego
Copy link
Member

@lukego lukego commented Apr 19, 2016

Enable a really important assertion that the packet freelist does not overflow when we allocate a new batch of packets.

This should not be a performance issue: the check is on a slow-path where we are allocating a thousand new packets.

This is actually very important. I found a bug that packetblaster would crash with heap corruption / segfault when you run it with more than 3 network interfaces at the same time. This is because it allocated too many packets for transmit/receive buffers and that error was not caught unless "developer debug" mode was enabled.

(That problem is separately alleviated by #883 that reduces the descriptor queues from 32K packets to 2K packets each.)

Enable a really important assertion that the packet freelist does not
overflow when we allocate a new batch of packets.

This should not be a performance issue: the check is on a slow-path
where we are allocating a thousand new packets.

This is actually very important. I found a bug that packetblaster
would crash with heap corruption / segfault when you run it with more
than 3 network interfaces at the same time. This is because it
allocated too many packets for transmit/receive buffers and that error
was not caught unless "developer debug" mode was enabled.

(That problem is separately alleviated by snabbco#883 that reduces the
descriptor queues from 32K packets to 2K packets each.)
@kbara kbara self-assigned this Apr 19, 2016
@kbara
Copy link
Contributor

kbara commented Apr 19, 2016

LGTM. Thank you for writing this; I think it's really important that Snabb handle these kinds of cases defensively. :-)

lukego added a commit to lukego/snabb that referenced this pull request Apr 20, 2016
@kbara kbara added the merged label Apr 29, 2016
kbara pushed a commit to kbara/snabb that referenced this pull request Apr 29, 2016
@eugeneia eugeneia merged commit 1ff037c into snabbco:master May 12, 2016
dpino added a commit to dpino/snabb that referenced this pull request Aug 9, 2017
[YANG] Empty data type binary compilation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants