Skip to content

Relooper can exhaust the stack when processing large functions #1908

Description

@randomPoison

Our relooper implementation is tail-recursive, meaning that as we process nodes in the CFG we recursively call into relooper to process the subsequent nodes. In working on #1827 I found that the threads used when running tests have a small enough stack size that we overflow the stack when trying to transpile the blake_256 test case. In that PR I work around it by spawning a thread with a larger stack, but that's not a robust solution. The proper fix here is to tweak relooper to use a loop when processing sequential nodes instead of tail-recursing after each Simple block. Should be straightforward to implement but I want to split it off of #1827 to avoid bloating that PR.

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