Skip to content

Extension crashing multiple times for unknown reason #142

Open
@skeymeulen

Description

Extension crashes multiple times when specific files are open in VSCode for unknown reasons in JS mode.

VSCode outputs:

The Semgrep server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Extension version: v1.7.1

Expected behaviour: Extension should not crash, or at least log clearly why it crashed.
Current Behavior: Extension crashes multiple times for unknown reasons.

How to reproduce
I have created a public repo containing an example file that can be used to reproduce this issue.
https://github.com/skeymeulen/semgrep-crash-example-repo

I'm running the VSCode plugin on a MacBook in JS mode and Only Git Dirty disabled.
When opening the index.js file in the example repo above, the integration start crashing, restarting and crashing again until VSCode stops restarting the server with the following message 'The Semgrep server crashed 5 times in the last 3 minutes. The server will not be restarted.'

The Semgrep logs in the VSCode output are always the same before the crash.

[Trace - 16:45:53] Received notification '$/progress'.
Params: {
    "token": "9d092828-8886-4ff2-ae5a-bb766f6eab6b",
    "value": {
        "kind": "begin",
        "message": "Refreshing Rules",
        "title": "Semgrep"
    }
}


/Users/myuser/.vscode/extensions/semgrep.semgrep-1.7.1/lspjs/dist/Main.bc.js:1947
throw err}function
^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "[object Array]".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

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