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

Excessive stack usage in FLambda middle end. #7842

vicuna opened this issue Aug 28, 2018 · 2 comments


None yet
3 participants
Copy link

commented Aug 28, 2018

Original bug ID: 7842
Reporter: @ejgallego
Assigned to: @chambart
Status: assigned (set by @chambart on 2018-08-31T23:34:23Z)
Resolution: open
Priority: low
Severity: minor
Platform: Linux
OS: Ubuntu
OS Version: 18.04
Version: 4.07.0
Category: middle end (typedtree to clambda)

Bug description

Dear OCaml devs, Jason Gross has reported a case where flambda-enabled ocamlopt stacks overflow whereas the normal version compiles fine.

Increasing the stack limit solves the issue, so I am unsure if you would even consider this a bug, but reporting anyways.

Original Coq issue: coq/coq#8313

Steps to reproduce

Download the file:

Then compile with 4.07.0+flambda. The stack trace is:

Fatal error: exception Stack overflow
Raised by primitive operation at file "middle_end/", line 739, characters 25-38
Called from file "middle_end/", line 739, characters 25-38


This comment has been minimized.

Copy link

commented Sep 10, 2018

Comment author: @chambart

The particular part of flambda that is failing is not tail recursive due to an optimization to limit allocations. It is possible to mitigate this without allocating too much, but this would be quite tedious. Would you consider that critical enough to dedicate more time to it ?


This comment has been minimized.

Copy link

commented Sep 10, 2018

Comment author: @ejgallego

I would dare to say that this is very low priority. Thanks for looking into it.

@vicuna vicuna added the middle-end label Mar 14, 2019

@nojb nojb added the flambda label Mar 16, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.