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 overflows while type checking programs with long chains of constructors #5368

Closed
vicuna opened this issue Oct 4, 2011 · 1 comment
Closed
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 4, 2011

Original bug ID: 5368
Reporter: till
Assigned to: @garrigue
Status: closed (set by @gasche on 2011-12-13T09:35:19Z)
Resolution: not fixable
Priority: normal
Severity: crash
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)

Bug description

Here's a quick script to generate a program with 100000 elements; on my current machine the compiler segfaults while trying to type check it:

cat > big_list.ml <<EOF
let big x = [
$(yes "true;" | head -n 100000)
]
EOF

(This bug was triggered on auto-generated code)

@vicuna
Copy link
Author

vicuna commented Dec 10, 2011

Comment author: @garrigue

There is no easy solution to this one.
Basically, the type inference algorithm being recursive, overly deep input leads to stack overflow, and only a major rewrite would solved that.
The error message could be improved, but I'm not sure there would be any benefit: if the list is that long, the reason is clear enough anyway...

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

No branches or pull requests

2 participants