Version française
Home     About     Download     Resources     Contact us    
Browse thread
cywgin stack overflow
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Olivier Andrieu <oandrieu@n...>
Subject: Re: [Caml-list] cywgin stack overflow
On 6/13/07, Alain Frisch <Alain.Frisch@inria.fr> wrote:
> Igor Peshansky wrote:
> > On Wed, 13 Jun 2007, Alain Frisch wrote:
> >> FYI, OCaml does not implement stack detection under Cygwin in native
> >> code (contrary to MSVC and Mingw ports), so the difference of behavior
> >> between ocamlopt and ocamlopt.opt is not suprising.  (I guess you get
> >> the equivalent of a segfault with ocamlopt.opt, but maybe nothing is
> >> printed.)
> >
> > In that case there should be a ocamlopt.opt.exe.stackdump somewhere...
> >
> > On a different note, why doesn't it?  Is there a special Cygwin flag that
> > disables that code?  Is the mechanism any different than on Linux?
>
> The technique to catch stack overflow is specific to the system. For
> Win32, it is implemented in byterun/win32.c (for unices, stack detection
> is implemented in asmrun/signals_asm.c). As far as I understand, win32.c
> is not used by the Cygwin port (which is considered as a Unix for the
> build process).

Indeed.

> I don't know whether the stack detection code in win32.c
> would work for Cygwin, but I don't see any reason why I wouldn't.

actually it doesn't work because Cygwin installs its own top-level
exception handler and it does mysterious things. You'd have to work
around it so that the ocaml one can do its job.

-- 
  Olivier