Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension crashing multiple times for unknown reason #142

Open
skeymeulen opened this issue Jun 5, 2024 · 3 comments
Open

Extension crashing multiple times for unknown reason #142

skeymeulen opened this issue Jun 5, 2024 · 3 comments

Comments

@skeymeulen
Copy link

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'
}
@ajbt200128
Copy link
Contributor

Going to look into this. Just wondering, why are you using JS mode on MacOS? Using the semgrep CLI instead of js mode will be way more performant and stable

@skeymeulen
Copy link
Author

I'm working on MacOS, so its easier for me to reproduce these issues on Mac. But a lot of my colleagues are on Windows, would be nice to have comparable experience on Windows.

@ajbt200128
Copy link
Contributor

ahh got it. The new version of the extension that should release sometime today (1.8.2) has improved error messaging when it comes to JS, and I fixed a few things up there too. Could you try the newest version and see if there's any improved error messaging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants