Intermittent exceptions during concurrent custom-rule execution
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 32/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- csharp, powershell
- Domínio
- cli, developer-experience, tooling
Direção de pesquisa
Start from how Invoke-ScriptAnalyzer runs external/custom rules concurrently (AstVisitor2 and $ScriptBlockAst.Visit) on Windows PowerShell 5.1, using the reported Visit NRE and collection-modified exceptions as the failure mode. Trace the custom-rule execution path and any shared visitor or AST state; done means those intermittent errors no longer appear on the same sources while default and custom rules still run.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Before submitting a bug report:
- Make sure you are able to repro it on the latest released version
- Perform a quick search for existing issues to check if this bug has already been reported
Steps to reproduce
...\PSScriptAnalyzer-Run.ps1" -Path C:\_work\1\s -Recurse -Settings C:\_work\1\.gdn\rs\psscriptanalyzer\63df5559-3449-4d0b-a8b9-8c97aa98fe3b.ruleset -IgnorePattern .gdn -IncludeDefaultRules -RecurseCustomRulePath -BuildInCustomRules SDLRules -OutputFilePath C:\_work\1\.gdn\.r\psscriptanalyzer\001\psscriptanalyzer.sarif
Expected behavior
Executing PSScriptAnalyzer without any errors
Actual behavior
A customer is intermittently seeing errors from "Invoke-ScriptAnalyzer" while PSScriptAnalyzer runs external SDL rules:
Exception calling "Visit" with "1" argument(s):
"Object reference not set to an instance of an object."
They have also seen:
Exception calling "Visit" with "1" argument(s):
"Collection was modified; enumeration operation may not execute."
The affected rules use a PowerShell class derived from "AstVisitor2" and call "$ScriptBlockAst.Visit($customVisitor)". The problem is intermittent: the same source can fail in one run and pass when rerun. PSScriptAnalyzer reports the exception as a non-terminating error and the process still exits with code 0.
Environment data
Environment: Windows PowerShell 5.1 and PSScriptAnalyzer 1.19.1.
Is this a known concurrency issue in PSScriptAnalyzer’s external-rule execution path or in "Ast.Visit()" under Windows PowerShell 5.1?
- Linguagem predominante
- C#
- Estrelas
- 2.2k
- Forks
- 423
- Merge médio
- 17h 27min
- PRs com merge (30d)
- 14
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PowerShell/PSScriptAnalyzer
-
Up-for-Grabs
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Issue - Bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
PowerShell/PSScriptAnalyzer#2229 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
PowerShell/PSScriptAnalyzer#2220 ·
Mantenedores costumam responder em até 1 dia
-
Resolution - Answered
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
PowerShell/PSScriptAnalyzer#2219 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
PowerShell/PSScriptAnalyzer#2218 · 1 reação · 2 responsáveis ·
Mantenedores costumam responder em até 1 dia
Todas as issues de PowerShell/PSScriptAnalyzer
Issues semelhantes
-
Add 'upm' tag on githubAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
bug mac アプリ: コード アプリ: チャット 優先: 中 要トリアージ
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
yksr-melt/Meltype#1346 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Collect corrected translations in the app, with no GitHub account and the least possible frictionAbertalocalization medium ui
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
hexide-io/HexIDE#2819 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100