aantron/dream

Segfault running example-1 with ocaml-multicore

Closed this issue · 4 comments

Hi, I just tried running the dream tutorials on ocaml.4.12+domains and it segfaulted after a minute or so. I can reproduce it with the first example using siege (though when it originally happened it was idle).

Here's the test-case as a Dockerfile:

FROM ocaml/opam:debian-11-ocaml-4.12-domains
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends siege
RUN git clone https://github.com/aantron/dream.git --recursive
WORKDIR dream
RUN opam-2.1 install --deps-only -t .
RUN opam-2.1 exec -- dune build ./example/1-hello/hello.exe
RUN (./_build/default/example/1-hello/hello.exe || echo CRASH &); sleep 1; siege http://127.0.0.1:8080/ 2> /dev/null

I get a crash within a second or so:

$ docker build .
[...]
Step 7/7 : RUN (./_build/default/example/1-hello/hello.exe || echo CRASH &); sleep 1; siege http://127.0.0.1:8080/ 2> /dev/nl
 ---> Running in efdb276b969f
10.01.22 13:57:03.735                       Running at http://localhost:8080
10.01.22 13:57:03.735                       Type Ctrl+C to stop
New configuration template added to /home/opam/.siege
Run siege -C to view the current settings in that file
Segmentation fault (core dumped)
CRASH

The crash is in caml_darken. Is Dream expected to work on multicore?

Dream is expected to work on multicore. cc @yawaramin, who observed a similar failure. I haven't had time to look into this yet.

Looks like this is a bug in Ssl's C stubs: savonet/ocaml-ssl#76

@talex5, many thanks for tracking that down!

This has been fixed upstream. Thanks again!