Skip to content

Endless loop + hang with 100% CPU usage in execEditLength() when calling structuredPatch() #364

Closed
@xeger

Description

@xeger

I encountered a hang in Yarn 3.2.0 and have isolated the root cause as an infinite loop in diff@4.0.1. (I'm not sure it's strictly infinite -- but it certainly doesn't terminate after an hour.) When Yarn asks diff to create a structured patch in order to show the user how the lockfile has changed, diff runs forever, consuming a lot of CPU while it does so.

I have reproduced the issue in this gist for your convenience.

I also verified that the hang still happens with diff@5.0.0 -- so it's still a legitimate issue. If I make any progress on diagnosing or fixing, I will update this ticket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions