-
Notifications
You must be signed in to change notification settings - Fork 382
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
Hang (possible deadlock) in PSScriptAnalyzer #1297
Comments
/cc @JamesWTruher |
The suspicion is that this is caused by the runspace pool deadlocking. The immediate solution is to rip that out, and down the line we should investigate implementing our own runspace pool. |
Possibly related: #1287 |
The next step I think is to get a proper stack trace on Windows using a debugging environment that can drill into the platform code; it would be nice to prove that this is a deadlock |
Ok, after a bit more analysis I believe this is the same issue as @SeeminglyScience describes in PowerShell/PowerShellEditorServices#762 (comment) |
Notice that the repro script contains a reference to |
windbg thread stack dump |
Looking at the windbg dump, I agree that definitely looks like the same issue. I'm not sure if there is anything on PSSA's end that can be done though. I got side tracked before I could submit a PR to oneget, but I've been running with these changes for a few months now without any issues. Not sure when I'll get to submitting that PR if someone else wants to take that on. (Note that the fix itself could use some refinement, if possible avoiding |
Unfortunately I think even if we get those changes into PackageManagement (which we should try to do), it will be hard to propagate them to users. Similarly, I think it's worth investigating if something can be done in PowerShell to prevent this, but it will only be possible to make such a change in PS 7. So I think PSSA and PSES will need to special case the PackageManagement cmdlet parameters. Not ideal, but not all that hard. And they're not going to change, especially with PSGet 3.0 coming. |
Ah right PSSA can do that, I forgot it's the one calling |
Steps to reproduce
Warning: Do this in a new process that you know the PID of -- it will lock up.
Expected behavior
PSSA emits any relevant diagnostics and returns
Actual behavior
Call never returns and does not respond to Ctrl+C
Environment data
Debugging this, it seems to occur around this call. This behaviour is not present in 1.18.0.
The text was updated successfully, but these errors were encountered: