English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Causes for segfaults
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-15 (18:50)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] Causes for segfaults
On Mon, Nov 15, 2010 at 07:38:25PM +0100, Jamie Brandon wrote:

> jamie@jamie-aspire:~$ cat > segfault.ml
> let rec ints n = n :: ints (n+1)
> let _ = ints 0
> jamie@jamie-aspire:~$ ocamlopt segfault.ml
> jamie@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.

-- 
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/