liburing icon indicating copy to clipboard operation
liburing copied to clipboard

`io_uring_peek_batch_cqe` does not populate `cqe` over FFI consistently!

Open YoSTEALTH opened this issue 8 months ago • 23 comments

After couple months of segfaults(over interpreter) narrowed the bug down to io_uring_peek_batch_cqe not populating cqe consistently. The first loop always runs fine after its anyone's guess as to when it will segfault from not populating cqe


while counter := ((io_uring_submit(ring) if io_uring_sq_ready(ring) else 0) + counter - cq_ready):

    # get count of how many event(s) are ready and fill `cqe`
    while not (cq_ready := io_uring_peek_batch_cqe(ring, cqe, counter)):
        io_uring_wait_cqe_nr(ring, cqe, 1)  # wait for at least `1` event to be ready.

    for i in range(cq_ready):
        # do stuff ...

YoSTEALTH avatar May 31 '24 21:05 YoSTEALTH