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
Array 4 MB size limit
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-05-16 (08:22)
From: Nicolas Cannasse <ncannasse@m...>
Subject: Re: [Caml-list] Array 4 MB size limit
>>Also, the fact that using lists crashes for the same data set is
>>surprising.  Is there a similar hard limit for lists, or would this be a
>>bug?  Should I post a test case?
> Depends on the platform you use.  In principle, Caml should report
> stack overflows cleanly, by throwing a Stack_overflow exception.
> However, this is hard to do in native code as it depends a lot on the
> processor and OS used.  So, some combinations (e.g. x86/Linux) will
> report stack overflows via an exception, and others will let the
> kernel generate a segfault.

A segfault will happen on Windows/MSVC port. I also found some cases
where the commandline program (the haXe compiler in that case) just
silently exited on Stack Overflow (exit code was not 0 but no error or
"program error" infamous message box was displayed).

I think that there is some MSVC specific C extension for catching such
stack overflows (__try / __except*). It would be nice to have such a
handling at the ocaml toplevel that would at least exit with a
meaningful error message. I don't care so much in my case since I'm not
using C code a lot, I know for sure that any crash/early abort is
indeeed a stack overflow. That might not be the case for all Win32 users.