Skip to content

Stack overflow error when attempting to trace deeply nested object #1200

@rohan-datar

Description

@rohan-datar

I'm working on creating a minimal reproduction of this, but when trying to trace an object that is deeply nested or uses many imports, trace will throw a stack overflow error. The basic context is that I am attempting to write some tests that run sanity checks on configuration written in pkl. The configuration amends a template that is defined in a remote module and is declared as a dependency is the PklProject file. The template itself imports a number of other modules that define type constraints and some output converters.

The test imports the configuration and defines some fact tests to check the sanity of the configuration. I am using import statements so that I can set some environment values that are otherwise provided at evaluation time. I wanted to trace the amended value to make sure that the values were being set correctly and ran into this error. The interesting thing is that the value can be operated on fine. Running comparisons for the facts works fine even for deeply nested values, but attempting to trace or render the same value produces a stack overflow error.

The error is too long to paste directly so I'm attaching it as a file:
trace_stack_overflow.txt

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