Using ocaml-3.09.3-win-msvc

 

When I compile the following program as byte code I see a stack overflow (expected).  When using ocamlopt it seems that the program dies and I do not see the expected overflow exception?

 

>type overflow.ml

let array_1=Array.make 229376 42;;

let _ = Printf.printf "A\n";;

flush stdout;;

 

let array_2=Array.make 32768 43;;

let _ = Printf.printf "B\n";;

flush stdout;;

 

let list_1 = Array.to_list(array_1);;

let _ = Printf.printf "C\n";;

flush stdout;;

 

let list_2 = Array.to_list(array_2);;

let _ = Printf.printf "D\n";;

flush stdout;;

 

let list_3 = list_1@list_2;;

let _ = Printf.printf "E\n";;

flush stdout;;

 

>ocamlc overflow.ml -o overflow_ocamlc.exe

>overflow_ocamlc.exe

A

B

C

D

Fatal error: exception Stack_overflow

 

>echo %ERRORLEVEL%

2

 

>ocamlopt overflow.ml -o overflow_ocamlopt.exe

>overflow_ocamlopt.exe

A

B

C

D

 

>echo %ERRORLEVEL%

-1073741819

 

Is this a bug?

 

Thanks,

 

-          Jakob Lichtenberg