Skip to content

Deeply nested revset crashes jj with a stack overflow #10071

Description

@DRMacIver

In any repo:

$ jj log -r "root()$(python3 -c "print('-'*1000)")"
thread 'main' (4221516) has overflowed its stack
fatal runtime error: stack overflow, aborting

(Debug build of main @ f2bdea4; a release build will need a deeper
expression, but the recursion is unbounded so some depth always crashes. I ran this on MacOS but it shouldn't be platform specific)

This is the same crash class as #4031, but the fix there (415c831) flattens
union nodes specifically; every other nestable operator still constructs an
unboundedly deep tree.

I found this while porting over the proptest tests to Hegel (sorry I'm so delayed on that. Ran into some issues doing it and then other stuff got on top of me).

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions