I’m not sure if this should be a bug report yet, hence starting a discussion here. I just wrote some seemingly innocuous code (no FFI, no Obj.magic
or other tricks) that should run fine (and does when compiled with the native compiler), but segfaults when run with ocaml
.
The file in question may be found here: nested-data-structure-traversal/object_fold.ml at 453837994b81188def0591b8ee6be2d3e3cd908a · josevalim/nested-data-structure-traversal · GitHub
I will say that there is moderate usage of objects, lists, and folding. But nothing extreme (in my opinion). Specifically the line that causes the segfault is the last line:
let () = List.iter print_section sections
Anyone experienced anything like this before/