Intermittent exceptions during concurrent custom-rule execution
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 32/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- csharp, powershell
- Domaine
- cli, developer-experience, tooling
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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?
- Langage dominant
- C#
- Étoiles
- 2.2k
- Forks
- 419
- Merge moyen
- 17 h 27 min
- PR mergées (30 j)
- 14
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PowerShell/PSScriptAnalyzer
-
Up-for-Grabs
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Issue - Bug
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
PowerShell/PSScriptAnalyzer#2229 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
PowerShell/PSScriptAnalyzer#2220 ·
Les mainteneurs répondent en général sous 1 jour
-
Resolution - Answered
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
PowerShell/PSScriptAnalyzer#2219 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 72/100
PowerShell/PSScriptAnalyzer#2218 · 1 réaction · 2 personnes assignées ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de PowerShell/PSScriptAnalyzer
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentOuvertebug 優先: 低
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
.NET area: storage bug good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Larson-Logan/medal-sync#61 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour