libxev icon indicating copy to clipboard operation
libxev copied to clipboard

[kqueue] More than 256 Kevents per tick causes OOB

Open steeve opened this issue 1 year ago • 1 comments

If there are more than 256 events to unpack per tick, because of the hard-coded 256 Kevents, an out of bounds crash happens at https://github.com/mitchellh/libxev/blob/43c7e4b3308f359e5b758db2d824d7c447f4ed3f/src/backend/kqueue.zig#L427

I'm not sure increasing the limit is worthwhile, I was thinking of just letting the loop run through another tick.

I found the problem using xev.Async.

steeve avatar Aug 21 '24 13:08 steeve

Good catch. I think increasing it is probably fine (just costs more stack space that we probably have available) but we should also make this more robust and spin the loop again if we can't handle all completions in one tick.

mitchellh avatar Aug 21 '24 13:08 mitchellh