Hi! I can provoke a segfault with close_out, and suspect a bug somewhere in ocaml 3.09.2 or the Pervasives module of ocaml 3.09.2, as shipping with Ubuntu feisty. To reproduce, save the attached files, use ocaml 3.09.2 and run #### ocamlopt unix.cmxa -o nosegfault nosegfault.ml ocamlopt unix.cmxa -o segfault segfault.ml ./nosegfault ; ./segfault #### The difference between segfault.ml and nosegfault.ml is the allocation of a large string #### let _ = String.create (Sys.max_string_length) in #### The bug appears for the second call to close_out. When I use Unix.close, there is no problem. The original code where the testcase is derived form ran fine when compiled with ocaml 3.08. When I use ocaml 3.10.0 the problem is gone. If someone can help discover why the segfault appears that would be nice. Since the bug disappears in ocaml 3.10, the bug is probably fixed, which one can check when the cause of the segfault is discovered. -- Sincerely | Homepage: Jørgen | http://www.hex.no/jhf | Public GPG key: | http://www.hex.no/jhf/key.txt