Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack overflow compiling medium size list constants #5844

Closed
vicuna opened this issue Dec 5, 2012 · 1 comment
Closed

stack overflow compiling medium size list constants #5844

vicuna opened this issue Dec 5, 2012 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Dec 5, 2012

Original bug ID: 5844
Reporter: craff
Assigned to: @gasche
Status: resolved (set by @gasche on 2012-12-05T10:35:09Z)
Resolution: suspended
Priority: normal
Severity: crash
Platform: intel amd 64
OS: linux
OS Version: debian testing
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)
Related to: #4405 #5626 #5925

Bug description

OCaml can not compile lists of size 30000 which is not a so big number.
This can not be caused only by a non tailrec function.
ocamlc
ocamlopt
ocamlc.opt -pp caml4o
ocamlopt.opt -pp caml4o
ocamlc -pp caml4o
ocamlopt -pp caml4o

all fail at 30000

ocamlc.opt and ocamlopt.opt works at 1000000 which seems enough to me

Steps to reproduce

produire un code source ocaml :
ocaml grandeliste.ml > foo.ml

le compiler:
ocamlc -c foo.ml

----------------- grandeliste.ml --------------------
open Printf

let _ =
printf "let l = [";
for i = 0 to 30000 do
printf "%d;\n" i
done;
printf "0]"
----------------- grandeliste.ml --------------------

Additional information

also reproduced with 4.00.0 with a MAC

@vicuna
Copy link
Author

vicuna commented Dec 5, 2012

Comment author: @gasche

For the record, here is the corresponding caml-list discussion:
"ocamlc, ocamlopt stackoverflow on list"
https://sympa.inria.fr/sympa/arc/caml-list/2012-11/msg00267.html

I still think this is a size issue for which the cost/benefit of a fix is not worth it. There is no point in, say, changing some code in the type-checker only to have a failure later in the closure conversion pass, or have a related failure on a slightly different input.

Marking the bug as "suspended" to indicate the low-priority status. If I have time and motivation I'll run a debugging-enabled version of the compiler on your example to get a stack trace. Feel free to investigate the issue on your side and provide patches if you think they solve your problem and have an extremely low risk of breaking anything or making the code harder to maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants