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

eio_luv: reading a stream after closing it crashes the event loop #424

Closed
talex5 opened this issue Jan 30, 2023 · 2 comments
Closed

eio_luv: reading a stream after closing it crashes the event loop #424

talex5 opened this issue Jan 30, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@talex5
Copy link
Collaborator

talex5 commented Jan 30, 2023

Seen in mirage/ocaml-cohttp#965:

Uncaught exception in run loop:
Exception: Invalid_argument("read_start: handle used after calling close!")
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
Called from Eio_luv.Low_level.Stream.read_into.(fun) in file "vendor/eio/lib_eio_luv/eio_luv.ml", line 512, characters 32-62

We should just discontinue the fiber with the exception, not kill the whole loop.

/cc @bikallem

@talex5 talex5 added the bug Something isn't working label Jan 30, 2023
@bikallem
Copy link
Contributor

@talex5 do you mean here?

| { fd = `Closed ; _ } -> invalid_arg (op ^ ": file descriptor used after calling close!")

It seems to be used in a few other places, i.e. getting the handle. It it okay if we discontinue in other use cases too?

@talex5
Copy link
Collaborator Author

talex5 commented Jan 31, 2023

Yes, but it's not worth spending a lot of time improving eio_luv, since we're planning to replace it anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants