Stack overflow analyzing script snippets
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza haciendo checkout del commit 5563b3cf300d4931704249525361f5cd510255d3 y ejecutando lint.ps1 en el entorno indicado de PowerShell 7.5.0 y PSScriptAnalyzer 1.23.0. Sigue el fallo a través de ScriptAnalyzer.Helper, CommandInfoCache y la regla AvoidAlias que aparece en el stack trace. Se considera completado cuando el script de lint termina sin un desbordamiento de pila.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Clone https://github.com/martincostello/github-automation/commit/5563b3cf300d4931704249525361f5cd510255d3
- Run
lint.ps1
Expected behavior
The script runs successfully.
Actual behavior
Linting actions/dotnet-release/action.yml...
Linting actions/dotnet-upgrade-report/action.yml...
Linting actions/dotnet-version-report/action.yml...
Linting actions/get-dotnet-repos/action.yml...
Linting actions/get-rebase-repos/action.yml...
Linting actions/get-sdk-repos/action.yml...
Linting actions/is-dotnet-change-available/action.yml...
Linting actions/lint-workflow-powershell/action.yml...
Linting .github/workflows/acr-housekeeping.yml...
Stack overflow.
Repeated 252 times:
--------------------------------
at System.Reflection.RuntimeAssembly.<InternalLoad>g____PInvoke|49_0(System.Reflection.NativeAssemblyNameParts*, System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.StackCrawlMarkHandle, Int32, System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.ObjectHandleOnStack)
at System.Reflection.RuntimeAssembly.InternalLoad(System.Reflection.AssemblyName, System.Threading.StackCrawlMark ByRef, System.Runtime.Loader.AssemblyLoadContext, System.Reflection.RuntimeAssembly, Boolean)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(System.Reflection.Assembly, System.Globalization.CultureInfo, System.Version, Boolean)
at System.Resources.ManifestBasedResourceGroveler.InternalGetSatelliteAssembly(System.Reflection.Assembly, System.Globalization.CultureInfo, System.Version)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(System.Globalization.CultureInfo)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)
at System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)
at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
at System.Management.Automation.ErrorCategoryInfo.Ellipsize(System.Globalization.CultureInfo, System.String)
at System.Management.Automation.ScriptBlock.GetContextFromTLS()
at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(System.Object, System.Object, System.Object[])
at DynamicClass.lambda_method523(System.Runtime.CompilerServices.Closure, System.Object, System.ResolveEventArgs)
at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(System.ResolveEventHandler, System.Reflection.RuntimeAssembly, System.String)
at System.Reflection.RuntimeAssembly.<InternalLoad>g____PInvoke|49_0(System.Reflection.NativeAssemblyNameParts*, System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.StackCrawlMarkHandle, Int32, System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.ObjectHandleOnStack)
--------------------------------
at System.Reflection.RuntimeAssembly.<InternalLoad>g____PInvoke|49_0(System.Reflection.NativeAssemblyNameParts*, System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.StackCrawlMarkHandle, Int32, System.Runtime.CompilerServices.ObjectHandleOnStack, System.Runtime.CompilerServices.ObjectHandleOnStack)
at System.Reflection.RuntimeAssembly.InternalLoad(System.Reflection.AssemblyName, System.Threading.StackCrawlMark ByRef, System.Runtime.Loader.AssemblyLoadContext, System.Reflection.RuntimeAssembly, Boolean)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(System.Reflection.Assembly, System.Globalization.CultureInfo, System.Version, Boolean)
at System.Resources.ManifestBasedResourceGroveler.InternalGetSatelliteAssembly(System.Reflection.Assembly, System.Globalization.CultureInfo, System.Version)
at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(System.Globalization.CultureInfo)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean)
at System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean)
at System.Resources.ResourceManager.GetString(System.String, System.Globalization.CultureInfo)
at Microsoft.PowerShell.Commands.CertificateProvider.InitializeDefaultDrives()
at System.Management.Automation.SessionStateInternal.InitializeProvider(System.Management.Automation.Provider.CmdletProvider, System.Management.Automation.ProviderInfo, System.Management.Automation.CmdletProviderContext)
at System.Management.Automation.SessionStateInternal.NewProvider(System.Management.Automation.ProviderInfo)
at System.Management.Automation.SessionStateInternal.AddProvider(System.Type, System.String, System.String, System.Management.Automation.PSSnapInInfo, System.Management.Automation.PSModuleInfo)
at System.Management.Automation.SessionStateInternal.AddSessionStateEntry(System.Management.Automation.Runspaces.SessionStateProviderEntry)
at System.Management.Automation.Runspaces.InitialSessionState.Bind_LoadProviders(System.Management.Automation.SessionStateInternal)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.Tasks.ThreadPoolTaskScheduler.TryExecuteTaskInline(System.Threading.Tasks.Task, Boolean)
at System.Threading.Tasks.TaskScheduler.TryRunInline(System.Threading.Tasks.Task, Boolean)
at System.Threading.Tasks.Task.WrappedTryRunInline()
at System.Threading.Tasks.Task.WaitAllCore(System.ReadOnlySpan`1<System.Threading.Tasks.Task>, Int32, System.Threading.CancellationToken)
at System.Threading.Tasks.Task.WaitAll(System.Threading.Tasks.Task[])
at System.Threading.Tasks.Parallel.Invoke(System.Threading.Tasks.ParallelOptions, System.Action[])
at System.Management.Automation.Runspaces.InitialSessionState.Bind(System.Management.Automation.ExecutionContext, Boolean, System.Management.Automation.PSModuleInfo, Boolean, Boolean, Boolean)
at System.Management.Automation.AutomationEngine..ctor(System.Management.Automation.Host.PSHost, System.Management.Automation.Runspaces.InitialSessionState)
at System.Management.Automation.Runspaces.LocalRunspace.DoOpenHelper()
at System.Management.Automation.Runspaces.RunspaceBase.CoreOpen(Boolean)
at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.CreateRunspace()
at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.OpenHelper()
at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.CoreOpen(Boolean, System.AsyncCallback, System.Object)
at System.Management.Automation.Runspaces.Internal.RunspacePoolInternal.Open()
at Microsoft.Windows.PowerShell.ScriptAnalyzer.CommandInfoCache..ctor()
at Microsoft.Windows.PowerShell.ScriptAnalyzer.Helper+<>c.<.ctor>b__24_0()
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at Microsoft.Windows.PowerShell.ScriptAnalyzer.Helper.get_CommandInfoCache()
at Microsoft.Windows.PowerShell.ScriptAnalyzer.Helper.GetCommandInfo(System.String, System.Nullable`1<System.Management.Automation.CommandTypes>, Boolean)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.AvoidAlias+<AnalyzeScript>d__9.MoveNext()
at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
at System.Linq.Enumerable.ToList[[System.__Canon, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
at Microsoft.Windows.PowerShell.ScriptAnalyzer.ScriptAnalyzer+<>c__DisplayClass84_1.<AnalyzeSyntaxTree>b__2()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
[process exited with code 3221225725 (0xc00000fd)]
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.23.0
- Lenguaje dominante
- C#
- Estrellas
- 2.2k
- Forks
- 415
- Merge medio
- 13 h 1 min
- PR fusionados (30 d)
- 2
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PowerShell/PSScriptAnalyzer
-
Up-for-Grabs
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
PowerShell/PSScriptAnalyzer#2217 · 1 comentario ·
-
PSUseConsistentIndentation double-indents attribute bodies that open a scriptblock (`[Attr({ … })]`) Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
PowerShell/PSScriptAnalyzer#2216 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
PowerShell/PSScriptAnalyzer#2211 ·
-
`PSPlaceOpenBrace` and `PSPlaceCloseBrace` leave trailing whitespace when expanding one-line blocks Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
PowerShell/PSScriptAnalyzer#2210 ·
Todos los issues de PowerShell/PSScriptAnalyzer
Issues similares
-
Add more to the documentation Abierto:watch: Not Triaged dotnet-fsharp/svc
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Azure/azure-sdk-for-net#63292 · 3 comentarios · 1 reacción ·
-
Issue-Enhancement Needs-Triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
PowerShell/PowerShell#28061 · 2 reacciones ·
-
dependencies needs-team-triage server-Azure.Mcp
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
dotnet/AspNetCore.Docs#37729 ·