On 2010 Nov 15, at 10:50 , Daniel de Rauglaudre wrote: > On Mon, Nov 15, 2010 at 07:38:25PM +0100, Jamie Brandon wrote: > >> ja...@jamie-aspire:~$ cat > segfault.ml >> let rec ints n = n :: ints (n+1) >> let _ = ints 0 >> ja...@jamie-aspire:~$ ocamlopt segfault.ml >> ja...@jamie-aspire:~$ ./a.out >> Segmentation fault > > Stack overflow in native code triggers a segmentation fault, indeed. > I think in C, it is the same thing. Not tested in the OCaml runtime > for efficiency purposes, I think. > > --
My 2 cents worth of ideas for efficient and safe stack frame allocation: http://cap-lore.com/code/BigStack.html On Mac: 172% uname -a Darwin apple-s-Computer.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386 172% ocaml -version The Objective Caml toplevel, version 3.12.0 172% cat > segfault.ml let rec ints n = n :: ints (n+1) let _ = ints 0 172% ocamlopt segfault.ml ld: in /usr/local/lib/ocaml/std_exit.o, indirect symbol index out of range collect2: ld returned 1 exit status File "caml_startup", line 1, characters 0-1: Error: Error during linking _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs