Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory access violation in FuncPtrInterop #674

Open
ForNeVeR opened this issue Oct 19, 2024 · 1 comment
Open

Memory access violation in FuncPtrInterop #674

ForNeVeR opened this issue Oct 19, 2024 · 1 comment
Labels
area:cil-interop Related to CIL (.NET) interop area:compiler Related to code compilation or type checking kind:bug Something isn't working status:help-wanted Open for contributors

Comments

@ForNeVeR
Copy link
Owner

ForNeVeR commented Oct 19, 2024

An occasional error from our CI:

16:52:36 [INF] > "C:\Program Files\dotnet\dotnet.exe" test D:\a\Cesium\Cesium\Cesium.CodeGen.Tests\Cesium.CodeGen.Tests.csproj --configuration Debug
  16:52:37 [DBG]   Determining projects to restore...
  16:52:38 [DBG]   All projects are up-to-date for restore.
  16:52:39 [DBG]   Cesium.Core -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.Core\debug\Cesium.Core.dll
  16:52:39 [DBG]   Cesium.Ast -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.Ast\debug\Cesium.Ast.dll
  16:52:39 [DBG]   Cesium.Solution.Metadata -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.Solution.Metadata\debug\Cesium.Solution.Metadata.dll
  16:52:39 [DBG]   Cesium.Preprocessor -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.Preprocessor\debug\Cesium.Preprocessor.dll
  16:52:39 [DBG]   Cesium.Parser -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.Parser\debug\Cesium.Parser.dll
  16:52:39 [DBG]   Cesium.CodeGen -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.CodeGen\debug\Cesium.CodeGen.dll
  16:52:39 [DBG]   Cesium.Runtime -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.Runtime\debug_net6.0\Cesium.Runtime.dll
  16:52:39 [DBG]   Cesium.TestFramework -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.TestFramework\debug\Cesium.TestFramework.dll
  16:52:39 [DBG]   Cesium.Compiler -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.Compiler\debug\Cesium.Compiler.dll
  16:52:40 [DBG]   Cesium.CodeGen.Tests -> D:\a\Cesium\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.Tests.dll
  16:52:40 [DBG] Test run for D:\a\Cesium\Cesium\artifacts\bin\Cesium.CodeGen.Tests\debug\Cesium.CodeGen.Tests.dll (.NETCoreApp,Version=v8.0)
  16:52:40 [DBG] VSTest version 17.11.1 (x64)
  16:52:40 [DBG] 
  16:52:40 [DBG] Starting test execution, please wait...
  16:52:40 [DBG] A total of 1 test files matched the specified pattern.
  16:52:41 [DBG] [xUnit.net 00:00:00.95]     Cesium.CodeGen.Tests.CodeGenTypeTests.LocalStructTest [SKIP]
  16:52:41 [DBG]   Skipped Cesium.CodeGen.Tests.CodeGenTypeTests.LocalStructTest [1 ms]
  Error: [xUnit.net 00:00:42.26]     Cesium.CodeGen.Tests.CodeGenNetInteropTests.FuncPtrInterop(architecture: Wide) [FAIL]
  16:53:23 [ERR] [xUnit.net 00:00:42.26]     Cesium.CodeGen.Tests.CodeGenNetInteropTests.FuncPtrInterop(architecture: Wide) [FAIL]
  16:53:23 [DBG]   Failed Cesium.CodeGen.Tests.CodeGenNetInteropTests.FuncPtrInterop(architecture: Wide) [3 s]
  16:53:23 [DBG]   Error Message:
  16:53:23 [DBG]    Assert.True() Failure
  16:53:23 [DBG] Expected: True
  16:53:23 [DBG] Actual:   False
  16:53:23 [DBG]   Stack Trace:
  16:53:23 [DBG]      at Cesium.TestFramework.ExecUtil.RunToSuccess(ITestOutputHelper output, String executable, String workingDirectory, String[] args, IReadOnlyDictionary`2 additionalEnvironment) in D:\a\Cesium\Cesium\Cesium.TestFramework\ExecUtil.cs:line 16
  16:53:23 [DBG]    at Cesium.TestFramework.CSharpCompilationUtil.CreateCSharpProject(ITestOutputHelper output, String directory) in D:\a\Cesium\Cesium\Cesium.TestFramework\CSharpCompilationUtil.cs:line 43
  16:53:23 [DBG]    at Cesium.TestFramework.CSharpCompilationUtil.CompileCSharpAssembly(ITestOutputHelper output, TargetRuntimeDescriptor runtime, String cSharpSource) in D:\a\Cesium\Cesium\Cesium.TestFramework\CSharpCompilationUtil.cs:line 34
  16:53:23 [DBG]    at Cesium.CodeGen.Tests.CodeGenNetInteropTests.DoTest(TargetArchitectureSet architecture, String cSharpCode, String cCode) in D:\a\Cesium\Cesium\Cesium.CodeGen.Tests\CodeGenNetInteropTests.cs:line 22
  16:53:23 [DBG] --- End of stack trace from previous location ---
  16:53:23 [DBG]   Standard Output Messages:
  16:53:23 [DBG]  $ dotnet new classlib --framework net8.0 --output TestProject
  16:53:23 [DBG]  The template "Class Library" was created successfully.
  16:53:23 [DBG]  
  16:53:23 [DBG]  Processing post-creation actions...
  16:53:23 [DBG]  Restoring C:\Users\runneradmin\AppData\Local\Temp\tmp1dz33d.tmp\TestProject\TestProject.csproj:
  16:53:23 [DBG]    Determining projects to restore...
  16:53:23 [DBG]  
  16:53:23 [DBG]  [ERR] Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  16:53:23 [DBG]  [ERR] Repeat 2 times:
  16:53:23 [DBG]  [ERR] --------------------------------
  16:53:23 [DBG]  [ERR]    at Microsoft.VisualStudio.Setup.Configuration.IEnumSetupInstances.Next(Int32, Microsoft.VisualStudio.Setup.Configuration.ISetupInstance[], Int32 ByRef)
  16:53:23 [DBG]  [ERR] --------------------------------
  16:53:23 [DBG]  [ERR]    at Microsoft.DotNet.Workloads.Workload.VisualStudioWorkloads.GetVisualStudioInstances()
  16:53:23 [DBG]  [ERR]    at Microsoft.DotNet.Workloads.Workload.VisualStudioWorkloads.GetInstalledWorkloads(Microsoft.NET.Sdk.WorkloadManifestReader.IWorkloadResolver, Microsoft.DotNet.Workloads.Workload.List.InstalledWorkloadsCollection, System.Nullable`1<Microsoft.NET.Sdk.WorkloadManifestReader.SdkFeatureBand>)
  16:53:23 [DBG]  [ERR]    at Microsoft.DotNet.Workloads.Workload.List.WorkloadInfoHelper.AddInstalledVsWorkloads(System.Collections.Generic.IEnumerable`1<Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadId>)
  16:53:23 [DBG]  [ERR]    at Microsoft.DotNet.Workloads.Workload.List.WorkloadInfoHelper.get_InstalledAndExtendedWorkloads()
  16:53:23 [DBG]  [ERR]    at Microsoft.DotNet.Tools.New.WorkloadsInfoProvider.GetInstalledWorkloadsAsync(System.Threading.CancellationToken)
  16:53:23 [DBG]  [ERR]    at Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint+<ExtractWorkloadInfoAsync>d__9.MoveNext()
  16:53:23 [DBG]  [ERR]    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint+<ExtractWorkloadInfoAsync>d__9, Microsoft.TemplateEngine.Edge, Version=8.0.403.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]](<ExtractWorkloadInfoAsync>d__9 ByRef)
  16:53:23 [DBG]  [ERR]    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.ValueTuple`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint+<ExtractWorkloadInfoAsync>d__9, Microsoft.TemplateEngine.Edge, Version=8.0.403.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]](<ExtractWorkloadInfoAsync>d__9 ByRef)
  16:53:23 [DBG]  [ERR]    at Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint.ExtractWorkloadInfoAsync(System.Collections.Generic.IEnumerable`1<Microsoft.TemplateEngine.Abstractions.Components.IWorkloadsInfoProvider>, Microsoft.Extensions.Logging.ILogger, System.Threading.CancellationToken)
  16:53:23 [DBG]  [ERR]    at Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint+<CreateAsync>d__6.MoveNext()
  16:53:23 [DBG]  [ERR]    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint+<CreateAsync>d__6, Microsoft.TemplateEngine.Edge, Version=8.0.403.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]](<CreateAsync>d__6 ByRef)
  16:53:23 [DBG]  [ERR]    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint+<CreateAsync>d__6, Microsoft.TemplateEngine.Edge, Version=8.0.403.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]](<CreateAsync>d__6 ByRef)
  16:53:23 [DBG]  [ERR]    at Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+WorkloadConstraint.CreateAsync(Microsoft.TemplateEngine.Abstractions.IEngineEnvironmentSettings, Microsoft.TemplateEngine.Abstractions.Constraints.ITemplateConstraintFactory, System.Threading.CancellationToken)
  16:53:23 [DBG]  [ERR]    at Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+<Microsoft-TemplateEngine-Abstractions-Constraints-ITemplateConstraintFactory-CreateTemplateConstraintAsync>d__5.MoveNext()
  16:53:23 [DBG]  [ERR]    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+<Microsoft-TemplateEngine-Abstractions-Constraints-ITemplateConstraintFactory-CreateTemplateConstraintAsync>d__5, Microsoft.TemplateEngine.Edge, Version=8.0.403.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]](<Microsoft-TemplateEngine-Abstractions-Constraints-ITemplateConstraintFactory-CreateTemplateConstraintAsync>d__5 ByRef)
  16:53:23 [DBG]  [ERR]    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Start[[Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory+<Microsoft-TemplateEngine-Abstractions-Constraints-ITemplateConstraintFactory-CreateTemplateConstraintAsync>d__5, Microsoft.TemplateEngine.Edge, Version=8.0.403.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]](<Microsoft-TemplateEngine-Abstractions-Constraints-ITemplateConstraintFactory-CreateTemplateConstraintAsync>d__5 ByRef)
  16:53:23 [DBG]  [ERR]    at Microsoft.TemplateEngine.Edge.Constraints.WorkloadConstraintFactory.Microsoft.TemplateEngine.Abstractions.Constraints.ITemplateConstraintFactory.CreateTemplateConstraintAsync(Microsoft.TemplateEngine.Abstractions.IEngineEnvironmentSettings, System.Threading.CancellationToken)
  16:53:23 [DBG]  [ERR]    at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke()
  16:53:23 [DBG]  [ERR]    at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
  16:53:23 [DBG]  [ERR]    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
  16:53:23 [DBG]  [ERR]    at System.Threading.ThreadPoolWorkQueue.Dispatch()
  16:53:23 [DBG]  [ERR]    at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
  16:53:23 [DBG]  [ERR] 
  16:53:23 [DBG]  Command exit code: -107374[181](https://github.com/ForNeVeR/Cesium/actions/runs/11370159460/job/31629277865#step:7:192)9
  16:53:23 [DBG] 
  16:53:23 [DBG] 
  16:53:25 [DBG] 
  16:53:25 [DBG] Failed!  - Failed:     1, Passed:   330, Skipped:     1, Total:   332, Duration: 43 s - Cesium.CodeGen.Tests.dll (net8.0)
  16:53:25 [DBG] 
  16:53:25 [DBG] Workload updates are available. Run `dotnet workload list` for more information.
  Error: Target "TestCodeGen" has thrown an exception
  16:53:25 [ERR] Target TestCodeGen has thrown an exception
  Nuke.Common.Tooling.ProcessException: Process 'dotnet.exe' exited with code 1.
@ForNeVeR ForNeVeR added kind:bug Something isn't working status:help-wanted Open for contributors area:cil-interop Related to CIL (.NET) interop area:compiler Related to code compilation or type checking labels Oct 19, 2024
@kant2002
Copy link
Collaborator

kant2002 commented Nov 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:cil-interop Related to CIL (.NET) interop area:compiler Related to code compilation or type checking kind:bug Something isn't working status:help-wanted Open for contributors
Projects
None yet
Development

No branches or pull requests

2 participants