-
Notifications
You must be signed in to change notification settings - Fork 388
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
Stack overflow analyzing script snippets #2056
Comments
Can you please try to narrow it down to a simpler repro? Multithreading issues sometimes only occur on certain CPU speeds which is maybe why it does not happen in GitHub actions |
To be honest, I don't have any good idea on where to start to narrow it down. I did try, for example I deleted the script it choked on to see if it then continued, but it just choked on the next one. It also seemed to be killing the pwsh terminal embedded within VS Code when I found it too. |
Divide and conquer is an effective method to minimise it. Remove half the code, if it still happens, half it again, if not, undo and remove other half, rinse and repeat |
I did do that to a degree, but there's only so much time in the day to dig into a technology I don't know the internals of. I spent about 10-15 minutes try to get to an "aha" moment, but this was impacting me while trying to do other work and I didn't want to go off into a full Hal moment. Once I finished my task, I opened this information with as far as I got. There's an issue somewhere because I don't reasonably see how this could be user error, but if you think the code provided to repro it is too much (you can ignore most of it, it's just the codebase the error was found in, the amount of PowerShell in there is minimal) and don't want to use that as a starting point then feel free to close this issue. |
Issue is still good to have in case someone else sees something similar and then the combination of traces sometimes brings something to light. But equally, we don't have that much time to investigate either. I see it's due to CommandInfo cache and in the past already spent a lot of time on exceptions by it. Conclusion was that this PowerShell internal object itself is not thread safe so suspect it's related to that. See PowerShell/PowerShell#12865 |
This afternoon I was writing a inline PowerShell script in a GitHub Actions workflow whose intention is to lint the usage of PowerShell in GitHub Actions workflows (♾), and while testing it locally with a slightly modified version I found I hit a stack overflow that terminated my pwsh session in Windows Terminal.
I can't reproduce it in GitHub Actions itself for some reason, but I can on my own laptop.
Steps to reproduce
lint.ps1
Expected behavior
The script runs successfully.
Actual behavior
Environment data
The text was updated successfully, but these errors were encountered: