[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MirageOS-devel] Unix.Unix_error(Unix.EBADF, "check_descriptor", "") (was: Irmin_http with Cohttp_mirage)



In the meantime I managed to get Irmin_http work together with Cohttp_mirage.Client (see other mail), but:

When I'm running my test suite against a unix-socket version of the unikernel, it eventually crashes with a weird exception 'Fatal error: exception Unix.Unix_error(Unix.EBADF, "check_descriptor", "")'. Of course it doesn't happen, if I run the kernel as a ukvm instance. I tried to catch the exception by wrapping all Irmin_http function calls with Lwt.catch()(), but without success. Also worth to note is, that I see the exception several times before, where it doesn't crash the unikernel, so it is actually caught in the cases before, but eventually there comes an event, where it is not caught. It's also not always the same moment during the test, but seems to depend on a racey condition. (Btw, http server and client are using the same conduit, but that shouldn't be a problem, right?) Here's the not so interesting backtrace:

2017-11-30 02:51:00 +01:00: INF [https] [1] serving //localhost:8080/api/v0/keys/myId123/actions/decrypt.
2017-11-30 02:51:00 +01:00: DBG [irmin.http] GET /branch/master
Fatal error: exception Unix.Unix_error(Unix.EBADF, "check_descriptor", "")
Raised at file "lwt_unix.cppo.ml", line 362, characters 4-64
Called from file "lwt_unix.cppo.ml", line 610, characters 28-47
Called from file "src/core/lwt.ml", line 2073, characters 21-28
Called from file "src/cohttp_mirage.ml", line 50, characters 41-59
Called from file "map.ml", line 196, characters 19-42
Called from file "src/unix/lwt_engine.ml", line 344, characters 16-68
Called from file "src/unix/lwt_main.ml", line 40, characters 4-78
Called from file "main.ml", line 170, characters 5-10


Some research shows that I'm not the first one seeing this, but unfortunately in the other cases the problem "mysteriously" disappeared. [1][2][3]

Also Tom Ridge and Hannes talked about the topic recently. [4]

Looking at the Lwt code[5] I'm a bit confused that raise and Lwt.fail are somehow used interchangeably. I'm still not sure that I understood how to deal correctly with exceptions in Lwt. :-/

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.