Igalia / snabb

Snabb Switch: Fast open source packet processing
Apache License 2.0
47 stars 5 forks source link

Add assert limit for stride value #1196

Closed dpino closed 5 years ago

dpino commented 5 years ago

When calling lib/ctable.lua:make_lookup_streamer with a stride value higher than 262144 (2^18), produces a segmentation fault (TABOV, table overflow error in LuaJIT). (https://stackoverflow.com/questions/25944489/luajit-table-overflow-error-when-loading-cdefs-using-ffi-cdef). To prevent this situation I added an assert limit.

One use case that can produce this situation is when packet drop monitor is called in a row 18 times. On each step the stride is increased, until a segfault is launched. I wonder whether it would be worthy to set a high limit for the stride value and print out a warning instead. Thoughts?