COMException (segmentation fault) when running HardwareCounters
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- csharp
- Área
- operating-systems, performance
Línea de trabajo
Comienza ejecutando la demo proporcionada de net8.0 con HardwareCounters y revisa el fallo en Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableKernelProvider, BenchmarkDotNet.Diagnostics.Windows.KernelSession.EnableProviders y EtwProfiler.Start. Reproduce la COMException de Windows 11 y determina qué debería requerir una ejecución correcta de los contadores de hardware; se considera terminado cuando el benchmark se ejecuta sin la excepción de recurso en uso ni un Segmentation fault.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello,
I am trying hardware counters for the first time after finding this article. I have unfortunately been unable to use these counters as I run into an exception when using them. I have stripped everything back to a tiny demo and still receive the error.
I'm on Windows 11 Pro.
My dotnet --version is 8.0.412.
$ dotnet run -c Release
// Validating benchmarks:
// ***** BenchmarkRunner: Start *****
// ***** Found 1 benchmark(s) in total *****
// ***** Building 1 exe(s) in Parallel: Start *****
// start dotnet restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true /p:ArtifactsPath="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1/" /p:OutDir="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\bin\Release\net8.0/" /p:OutputPath="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\bin\Release\net8.0/" /p:PublishDir="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\publish/" in C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1
// command took 0.62 sec and exited with 0
// start dotnet build -c Release --no-restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true /p:ArtifactsPath="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1/" /p:OutDir="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\bin\Release\net8.0/" /p:OutputPath="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\bin\Release\net8.0/" /p:PublishDir="C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\publish/" --output "C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\bin\Release\net8.0/" in C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1
// command took 3.23 sec and exited with 0
// ***** Done, took 00:00:03 (3.88 sec) *****
// Found 1 benchmarks:
// DemoClass.Demo: DefaultJob
Setup power plan (GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c FriendlyName: High performance)
// **************************
// Benchmark: DemoClass.Demo: DefaultJob
// *** Execute ***
// Launch: 1 / 1
// Execute: dotnet Benchmarking-DefaultJob-1.dll --anonymousPipes 1764 1440 --benchmarkName DemoClass.Demo --job Default --benchmarkId 0 in C:\Users\{some-directory}\bin\Release\net8.0\Benchmarking-DefaultJob-1\bin\Release\net8.0
Unhandled exception. System.Runtime.InteropServices.COMException (0x800700AA): The requested resource is in use. (0x800700AA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at Microsoft.Diagnostics.Tracing.Session.TraceEventSession.EnableKernelProvider(Keywords flags, Keywords stackCapture)
at BenchmarkDotNet.Diagnostics.Windows.KernelSession.EnableProviders()
at BenchmarkDotNet.Diagnostics.Windows.EtwProfiler.Start(DiagnoserActionParameters parameters)
at BenchmarkDotNet.Diagnostics.Windows.EtwProfiler.Handle(HostSignal signal, DiagnoserActionParameters parameters)
at BenchmarkDotNet.Diagnosers.CompositeDiagnoser.Handle(HostSignal signal, DiagnoserActionParameters parameters)
at BenchmarkDotNet.Toolchains.DotNetCli.DotNetCliExecutor.Execute(BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, ILogger logger, ArtifactsPaths artifactsPaths, IDiagnoser diagnoser, String executableName, IResolver resolver, Int32 launchIndex)
at BenchmarkDotNet.Toolchains.DotNetCli.DotNetCliExecutor.Execute(ExecuteParameters executeParameters)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.RunExecute(ILogger logger, BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, IToolchain toolchain, BuildResult buildResult, IResolver resolver, IDiagnoser diagnoser, Int32 launchIndex)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.Execute(ILogger logger, BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, IToolchain toolchain, BuildResult buildResult, IResolver resolver)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.RunCore(BenchmarkCase benchmarkCase, BenchmarkId benchmarkId, ILogger logger, IResolver resolver, BuildResult buildResult)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo benchmarkRunInfo, Dictionary`2 buildResults, IResolver resolver, ILogger logger, EventProcessor eventProcessor, List`1 artifactsToCleanup, String resultsFolderPath, String logFilePath, Int32 totalBenchmarkCount, StartedClock& runsChronometer, Int32& benchmarksToRunCount, TaskbarProgress taskbarProgress)
at BenchmarkDotNet.Running.BenchmarkRunnerClean.Run(BenchmarkRunInfo[] benchmarkRunInfos)
at BenchmarkDotNet.Running.BenchmarkRunner.RunWithDirtyAssemblyResolveHelper(Type type, IConfig config, String[] args)
at BenchmarkDotNet.Running.BenchmarkRunner.<>c__DisplayClass0_0`1.<Run>b__0()
at BenchmarkDotNet.Running.BenchmarkRunner.RunWithExceptionHandling(Func`1 run)
at BenchmarkDotNet.Running.BenchmarkRunner.Run[T](IConfig config, String[] args)
at Program.<Main>$(String[] args) in C:\Users\{some-directory}\Program.cs:line 5
Successfully reverted power plan (GUID: 381b4222-f694-41f0-9685-ff5bb260df2e FriendlyName: Balanced)
// * Artifacts cleanup *
Artifacts cleanup is finished
Segmentation fault
Here is my program.
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Running;
var summary = BenchmarkRunner.Run<DemoClass>();
Console.WriteLine(summary);
[MemoryDiagnoser]
[HardwareCounters(HardwareCounter.BranchMispredictions, HardwareCounter.BranchInstructions)]
public class DemoClass
{
[Benchmark]
public int Demo() => 1 + 2;
}
And here is my csproj.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../{ProgramName}.csproj" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.2" />
</ItemGroup>
</Project>
- Lenguaje dominante
- C#
- Estrellas
- 11.5k
- Forks
- 1.1k
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 24
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 dotnet/BenchmarkDotNet
-
0.16.0-preview.2: generated CompilerFeatureRequiredAttribute collides with a source-only polyfill package on .NET Framework jobs (CS0101)Posiblemente ocupada @mohamed-warda la tomó hace 3 días. AbiertoArea:Toolchains good first issue up-for-grabs
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
dotnet/BenchmarkDotNet#3296 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
The information displayed as available memory is inaccurate on macos/LinuxPosiblemente ocupada @sabtain05 la tomó hace 2 días. Abierto
Dificultad 4/5 1-2 días Aptitud para principiantes 53/100
dotnet/BenchmarkDotNet#3287 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
dotnet/BenchmarkDotNet#3285 ·
Los mantenedores suelen responder en 1 día
-
Area:Toolchains up-for-grabs
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
dotnet/BenchmarkDotNet#3266 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Area:Diagnosers
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
dotnet/BenchmarkDotNet#3246 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de dotnet/BenchmarkDotNet
Issues similares
-
bug priority: P2
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
[Docs] README/PRIVACY still name AppCenter although v1.5.6.0+ uses the Microsoft Store Services SDKAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Azure/azure-sdk-tools#17317 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
swisstopo/swissgeol-boreholes-suite#3086 ·
Los mantenedores suelen responder en 1 día