| Anonymous | Login | Signup for a new account | 2013-05-23 05:27 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0004405 | OCaml | OCaml general | public | 2007-09-25 18:47 | 2013-02-18 11:27 | |||
| Reporter | vbigiani | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | crash | Reproducibility | always | |||
| Status | closed | Resolution | no change required | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.10.0 | |||||||
| Target Version | Fixed in Version | |||||||
| Summary | 0004405: ocamlopt, ocaml, ocamlc, Stack Overflow on large hardcoded arrays. | |||||||
| Description | If a .ml file contains an array that is of large size, ocamlopt(.opt).exe, ocaml.exe and ocamlc.(opt).exe all crash with a Stack Overflow exception. It happens if the array has 274 896 elements, but not if it has 60 000 elements. If I split the array in smaller parts and then I call Array.concat to merge them into the original array, the resulting program will work correctly. In the attachment, crash.ml has a single 274 896 arrays and will crash all the aforementioned programs, whereas no-crash.ml has splitted the array in five parts and doesn't crash (and, FWIW, can Array.iter and Array.get without trouble). | |||||||
| Additional Information | Windows X86, OCaml 3.10.0 / MinGW. | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Relationships |
|||||||||||
|
|||||||||||
Notes |
|
|
(0004233) thelema (reporter) 2007-11-02 20:01 |
Can't reproduce: Using mandriva build of ocaml 3.10.0, 'ocamlc crash.ml' produces a perfectly good a.out file, without crashing. This is on 32-bit linux x86. |
|
(0004237) xleroy (administrator) 2007-11-06 16:27 |
The compilers use stack space proportional to the size of the array expression. So, yes, you can get stack overflow conditions at compile-time. With the "non-opt" compilers ocamlc, ocamlopt, you can easily increase the stack space available to the compiler: set the OCAMLRUNPARAM environment variable to e.g. "l=10M" (10 mega-words of stack space, instead of the default 1 mega-words). Increasing the stack space for ocamlc.opt and ocamlopt.opt is OS-dependent and is not possible under Windows as far as I know. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2007-09-25 18:47 | vbigiani | New Issue | |
| 2007-09-25 18:47 | vbigiani | File Added: stack.tar.bz2 | |
| 2007-11-02 20:01 | thelema | Note Added: 0004233 | |
| 2007-11-06 16:27 | xleroy | Note Added: 0004237 | |
| 2007-11-06 16:27 | xleroy | Status | new => closed |
| 2007-11-06 16:27 | xleroy | Resolution | open => no change required |
| 2012-12-05 11:34 | gasche | Relationship added | related to 0005844 |
| 2013-02-18 11:27 | gasche | Relationship added | related to 0005925 |
| Copyright © 2000 - 2011 MantisBT Group |