In the end it was an easy fix:

https://github.com/mirage/ocaml-cohttp/pull/589


Sven Anderson <[email protected]> schrieb am Di., 5. Dez. 2017 um 22:28 Uhr:

> Hi all,
>
> I finally could make a pretty small reproducer for the uncatchable
> exception Unix.Unix_error(Unix.EBADF, "check_descriptor", ""). I put the
> sources in a gist [1]. The trick to trigger the bug is to have a persistent
> HTTP connection to the server and reuse it for many HTTP requests. What
> also seems to be important is, that the request triggers another client
> request to an external HTTP server. (My reproducer is a very primitive
> static proxy, so to say.) Also it seems to depend on the amount of data
> that is forwarded through the unikernel. And of course it only happens with
> --net=socket.
>
> After compiling and running the unikernel, it must be tortured with the
> following command:
> $ printf 'url="http://localhost:8080"\n%.0s' {1..1000} | curl -v -K -
> and it should fail pretty quickly.
>
> It's a pretty racey bug, sometimes the exception is caught by my own
> exception handler, sometimes it's caught by Cohttp, and sometimes it is
> caught by the Lwt scheduler, which terminates the whole process then.
>
> So my guess at the moment is, that there are two problems: a memory leak
> when reusing HTTP connections, which again triggers an exception that is
> not handled properly.
>
> So, first question would be: where to file the bug? Is it a Cohttp bug? Or
> Lwt? Or both?
>
> I'm happy to investigate that further, if someone explains me how to get a
> useful backtrace for the exception.
>
>
> Cheers,
>
> Sven
>
> [1] https://gist.github.com/ansiwen/baece8a522d5974310f3001b8db8e015
>
_______________________________________________
MirageOS-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/mirageos-devel

Reply via email to