Skip to content

Stack overflow during native compilation. #10072

@pveber

Description

@pveber

cc @LaurentMazare

The compilation of the current HEAD of the ocaml-torch library fails during an ocamlopt invocation with a stack overflow. As reported in LaurentMazare/ocaml-torch#50, the problem stems from a generated module which is pretty large (more than 6000 lines), and can be bypassed by increasing the stack size. In addition the compilation of this module requires more than 6 GB of memory on my configuration.

This kind of behaviour is very unusual to me, so I thought it might be a performance bug, hence this report. To make it easier to reproduce, I made a standalone example, that doesn't require anything besides a working compiler. Just invoking make should reproduce the error. The stack trace strongly suggests that the culprit is the Spill.spill function which is non-terminal recursive. I observed the problem on versions 4.11.1, 4.12.0~alpha2 and trunk (0f7d0a640).

Let me know if I can be of some help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions