You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6364 Reporter: kerneis Status: resolved (set by @xavierleroy on 2014-06-05T14:30:57Z) Resolution: suspended Priority: normal Severity: crash Version: 4.01.0 Category: back end (clambda to assembly) Related to:#5626#5925
Bug description
The following file (too large to be hosted on Mantis) is a 5.4MB .ml file generated automatically:
It consists of a few type definitions for an AST, and then a single, huge term (let defs starting on line 448). It is probably pathological, but here is what happens when I try and compile it anyway:
The culprit seems to be non-tail recursion in the backend, in particular Compilenv.structured_constants, which uses List.map (and so could be easily fixed), and Comballoc.combine, which requires a bit more work.
In the meantime, you may be able to work around the issue with something like 'ulimit'. The following works for me:
I am marking this PR as "suspended" for the reasons given in #5925, namely: making the native-code generator tail-recursive is a very invasive change, and supporting huge generated source files is a low priority.
Original bug ID: 6364
Reporter: kerneis
Status: resolved (set by @xavierleroy on 2014-06-05T14:30:57Z)
Resolution: suspended
Priority: normal
Severity: crash
Version: 4.01.0
Category: back end (clambda to assembly)
Related to: #5626 #5925
Bug description
The following file (too large to be hosted on Mantis) is a 5.4MB .ml file generated automatically:
https://gist.githubusercontent.com/kerneis/9af54c536d5e07b9e2c8/raw/0c5ee22ea5d37143d56116977eccdd2d133f64a7/gistfile1.ml
It consists of a few type definitions for an AST, and then a single, huge term (let defs starting on line 448). It is probably pathological, but here is what happens when I try and compile it anyway:
$ ocamlc.opt -c -o power.cmo gistfile1.ml
$ ocamlopt -c -o power.cmx gistfile1.ml
Fatal error: exception Stack_overflow
I get the same results with ocamlc.opt and ocamlopt.opt.
I'm not sure it's worth spending too many efforts fixing, but I figured it might help uncover some bug in ocamlopt.
File attachments
The text was updated successfully, but these errors were encountered: