> Dear Grzegorz,
> I have read your patch and I think it is good. I realize this may
> sound amazing, but I was very confused on when these calls are needed
> and when not. I tried my best and my own filesystem did not crash, but
> other users recently reported similar issues to yours, and we did not
> managed to get anything done.
Originally the crashes were quite difficult to reproduce (it would
take minutes/tens of minutes to get a segfault). However, as soon as I
moved my tests to a faster machine, with more CPUs (more
concurrency?), we would get segfaults within seconds. Then it got much
easier to debug it (I attached gdb to the process, and saw bogus gc
roots ... read bits of GC code, and figured out what needs to be
>> Note that we are not OCaml experts
> I am neither, when it comes to the foreign function interface, and
> unfortunately I was not able to find anyone interested in the ocaml
> community, so I had to resort to the best I could get of it, and
> testing that did not show crashes for me.
Yeah. Unless you understand how the GC works (which I still don't
fully) CAML* macros look quite odd. I think the best solution to the
problem would be to augment the OCaml memory allocator, to check that
that you've registered an appropriate root, when you are asking for
some memory. This shouldn't be too hard to do, and would save quite a
lot of time for anyone who binds to OCaml from another language (also,
a mistake we originally made [which actually helped to debug the
problem quicker] was to use OCAML* macros in the blocking section,
which is clearly invalid. It wouldn't be very hard to extend the
macros to warn you against such invalid use). Something to suggest to
the OCaml community maybe.
> Thanks for this patch, tomorrow I am leaving for a conference, but
> when I will be back next week I will apply it and ask the other users
> facing the same problems to test it.
Sounds good. Let me know what the results are.
> May I ask you who is "we" in "we have been experimenting"?
I work for a storage startup called Acunu (http://www.acunu.com/). A
couple of my colleagues seem to be quite fond of OCaml, and test their
ideas using OcamlFuse. I just helped to debug the crashes (anything to
do with C seems to be my responsibility :)).
> Anyways, I will try to ask for a proofreading of that module again to
> the ocaml mailing list, maybe this time I will be luckier.