Skip to content

Conversation

edwintorok
Copy link
Contributor

Fixes #88

edwintorok and others added 3 commits May 14, 2023 23:53
Handle the case where `cqe` is NULL.
This can happen when `polling_timeout` is used in `Uring.create`.

Signed-off-by: Edwin Török <[email protected]>
```
File "uring/lib/uring/region.ml", line 8, characters 2-13:
8 |   slots: int;
      ^^^^^^^^^^^
Error (warning 69 [unused-field]): record field slots is never read.
(However, this field is used to build or mutate values.)
```

Signed-off-by: Edwin Török <[email protected]>
@talex5
Copy link
Collaborator

talex5 commented May 15, 2023

Looks like the behaviour of io_uring_submit_and_wait_timeout changed (see axboe/liburing#684). Previously it returned ETIME for a timeout, but now if it managed to submit something then it returns the number of items submitted instead. Therefore, you can now get success with no CQE.

I've added a test to your branch to check the fix.

Copy link
Collaborator

@talex5 talex5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@talex5 talex5 merged commit ff1b56e into ocaml-multicore:main May 15, 2023
@avsm
Copy link
Contributor

avsm commented May 15, 2023

Good catch, thanks @edwintorok!

mseri pushed a commit to ocaml/opam-repository that referenced this pull request May 16, 2023
CHANGES:

- Fix SIGSEGV on `Uring.wait` (@edwintorok ocaml-multicore/ocaml-uring#89).
  `io_uring_submit_and_wait_timeout` can return a success status but with a NULL `cqe`.

- Remove unused variable in C stub (@talex5 ocaml-multicore/ocaml-uring#87).

- Use `caml_enter_blocking_section` when calling `io_uring_submit` (@TheLortex ocaml-multicore/ocaml-uring#86).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SIGSEGV on connect

3 participants