On Sun, Dec 20, 2020 at 8:57 PM wrote: > Hello, > > May global roots be initialized to (value)NULL ? > Yes, in the default OCaml configuration as of today. No, in the "no naked pointers" mode that was introduced in OCaml 4.02.0, made much stricter in OCaml 4.12.0, and will be the default in OCaml 5.0. To be future-proof and on the safe side, I would suggest to initialize to e.g. Val_unit. > I have a multithreaded program, which segfault in callback_asm, while I > think I respect all rules of c interfaces... Except maybe the above... > There is an OPAM compiler switch "4.10.0+nnpcheck" that adds run-time checks for ill-formed values according to the no-naked-pointers rules. Maybe you could use it to rule out this potential problem. Hope this helps, - Xavier Leroy > Chevets, > Christophe > -- > Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma > brièveté.