Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Problem with ocamlopt
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Franck Delaplace <delapla@l...>
Subject: Re: [Caml-list] Problem with ocamlopt
>
>
> > PS: You will find attached the source code 
>
>When trying to read it, one of my brain modules threw an exception:
>Stack overflow.  [:-)] 
>
>
Thank you to attempt to read it. You're a pioneer . What does it talk 
about ? :-)

>Hi Franck,
>
>Actually I only wrote to make that joke, but to be a bit more useful:
>It might be that the constructs used by the code generator you used to
>translate the FA definitions into ocaml nest somewhat too deeply, and
>since the ocamlcompiler parses recursive descendend (i think) its
>stack overflows at some point or other.
>
>
>
>Suggestions:
>
>   * Try cutting down your FA, let's say to half as a test case and
>     compile it then. Does it overflow still? 
>
Yes it does if the code it still in a single file.
If it is splitted in more than one file it is ok

>If things are like I suggest,
>     that is should be called a tagcc bug, since there is IMHO no
>     reason for FA execution to use nested constructs this way
>     (nesting too deeply).
>
>Regards -- Markus
>
>
>
here another Stack overflow for a simpler program

let t = [| 

  [|
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0)
  |];

repeat the previous  array more than 390 times  ....

[|
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0)
  |]

|] ;;

Now, if I split it into several  different arrays but in the same file, 
There is also the same error.
If each line is replaced by (ugly code)

let t = Array.make 400 [||] ;;
let i = ref 0 ;;

(incr i ; t.(!i) <-
[|
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0);
    (1,[|1 ;1;1|],1.0)
  |] );; 

There still an error
I use ocamlc now which works well.
Thank you for your advice.


-- 
Franck Delaplace @w3:http://www.lami.univ-evry.fr/~delapla/ <http://www.lami.univ-evry.fr/%7Edelapla/>
Equipe BioInfo, La.M.I-U.M.R 8042 C.N.R.S
523 Place des Terrasses 
91025 Evry CEDEX (France)