Skip to content

Panics originating in a requestAnimationFrame loop silently freeze the editor #3402

@Keavon

Description

@Keavon

We expect that anytime Graphite's Rust code panics, it should display the crash dialog. This can be triggered successfully from the Help > Developer Debug > Trigger a Crash menu, which creates the following call stack:

Image

But some of our code (which is also susceptible to panicking) runs in the recursive requestAnimationFrame loop, where its call stack is essentially infinite (there is one per frame since the application was initialized— notice the scrollbar below which is also still truncated):

Image

One good way to reproduce this is to add a panic!(); line to the body of fn brightness_contrast_properties() in node_properties.rs, then create a Brightness/Contrast node in the graph, and then select it so that function runs to generate its Properties panel content. The editor will freeze, but won't display a crash dialog. Check the console and you'll see a panic log with a really long call stack due to the requestAnimationFrame recursion.

This needs to be solved so our panic handler architecture is able to detect and handle this class of situations just like it does in the regular non-recursive call stack situation.

This is important because freezing without informing the user explicitly that a crash occurred is confusing and frustrating, and means that we won't receive crash reports about those situations either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Short-Term

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions