Intermittent exceptions during concurrent custom-rule execution
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- csharp, powershell
- Ambito
- cli, developer-experience, tooling
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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?
- Lingua principale
- C#
- Stelle
- 2.2k
- Fork
- 423
- Merge medio
- 17h 27m
- PR unite (30g)
- 14
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PowerShell/PSScriptAnalyzer
-
Up-for-Grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Issue - Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
PowerShell/PSScriptAnalyzer#2229 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
PowerShell/PSScriptAnalyzer#2220 ·
I maintainer di solito rispondono entro 1 giorno
-
Resolution - Answered
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
PowerShell/PSScriptAnalyzer#2219 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
PowerShell/PSScriptAnalyzer#2218 · 1 reazione · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PowerShell/PSScriptAnalyzer
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentApertabug 優先: 低
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
.NET area: storage bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Larson-Logan/medal-sync#61 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno