I experienced an issue with ocamlfuse when it’s compiled with OCaml 5 or later. Basically, it crashes when run in the default background mode, but it works fine if run in foreground. Google brought me to this PR in the OCaml repo, where it explains that the problem is caused by a
fork() call in the C code (that
libfuse calls here to daemonize the process). After the fork, the first call to
caml_release_runtime_system crashes the process with
SIGABRT. The workaround is to call the internal
fork. Indeed, I tried the workaround and it looks like it’s working fine. The thing that I don’t like very much is that I need to call an internal OCaml function, so I get also the risk of an unexpected breaking change. So I’m asking the community if there is a better way to solve the issue (unfortunately
fork is called by the library so I don’t have control on that and I cannot patch it to call
Unix.fork). Thanks in advance for any advice.