nanoframework / Home

:house: The landing page for .NET nanoFramework repositories.
https://www.nanoframework.net
MIT License
844 stars 75 forks source link

`nanoCLR` throws a System.AccessViolationException on Windows Server 2022 #1501

Closed CoryCharlton closed 3 weeks ago

CoryCharlton commented 4 weeks ago

Tool

nanoCLR

Description

Output on Windows 2019 hosted runner:

2024-06-09T18:38:56.0434330Z .NET nanoFramework nanoCLR CLI v1.0.569+1f788964e7
2024-06-09T18:38:56.0448626Z Copyright (C) 2021 .NET Foundation and nanoFramework project contributors
2024-06-09T18:38:56.0449212Z 
2024-06-09T18:38:56.0449219Z 
2024-06-09T18:38:56.2246973Z 
2024-06-09T18:38:56.2248161Z Loading nanoCLR v1.9.1.0
2024-06-09T18:38:56.2274046Z ...Starting...
2024-06-09T18:38:56.2277527Z Created EE.
2024-06-09T18:38:56.2278039Z Started Hardware.
2024-06-09T18:38:56.2281116Z Loading Assemblies.
2024-06-09T18:38:56.2281742Z Loading Deployment Assemblies.
2024-06-09T18:38:56.2282399Z Resolving.
2024-06-09T18:38:56.2282679Z 
2024-06-09T18:38:56.2283201Z Total: (0 RAM - 0 ROM - 0 METADATA)
2024-06-09T18:38:56.2283724Z 
2024-06-09T18:38:56.2284028Z    AssemblyRef    =        0 bytes (       0 elements)
2024-06-09T18:38:56.2284821Z    TypeRef        =        0 bytes (       0 elements)
2024-06-09T18:38:56.2285475Z    FieldRef       =        0 bytes (       0 elements)
2024-06-09T18:38:56.2286192Z    MethodRef      =        0 bytes (       0 elements)
2024-06-09T18:38:56.2286906Z    TypeDef        =        0 bytes (       0 elements)
2024-06-09T18:38:56.2287483Z    FieldDef       =        0 bytes (       0 elements)
2024-06-09T18:38:56.2288082Z    MethodDef      =        0 bytes (       0 elements)
2024-06-09T18:38:56.2288552Z    StaticFields   =        0 bytes (       0 elements)
2024-06-09T18:38:56.2288836Z 
2024-06-09T18:38:56.2288993Z    DebuggingInfo  =        0 bytes
2024-06-09T18:38:56.2289231Z 
2024-06-09T18:38:56.2289409Z    Attributes      =        0 bytes (       0 elements)
2024-06-09T18:38:56.2289962Z    TypeSpec        =        0 bytes (       0 elements)
2024-06-09T18:38:56.2290461Z    Resources Files =        0 bytes (       0 elements)
2024-06-09T18:38:56.2290921Z    Resources       =        0 bytes (       0 elements)
2024-06-09T18:38:56.2291352Z    Resources Data  =        0 bytes
2024-06-09T18:38:56.2291711Z    Strings         =        0 bytes
2024-06-09T18:38:56.2292052Z    Signatures      =        0 bytes
2024-06-09T18:38:56.2292403Z    ByteCode        =        0 bytes
2024-06-09T18:38:56.2292616Z 
2024-06-09T18:38:56.2292648Z 
2024-06-09T18:38:56.2292746Z Error: a2000000
2024-06-09T18:38:56.2293019Z Exiting.

Output on Windows 2022 hosted runner:

2024-06-09T18:39:17.3209874Z .NET nanoFramework nanoCLR CLI v1.0.569+1f788964e7
2024-06-09T18:39:17.3224081Z Copyright (C) 2021 .NET Foundation and nanoFramework project contributors
2024-06-09T18:39:17.3224939Z 
2024-06-09T18:39:17.3224948Z 
2024-06-09T18:39:17.6924799Z 
2024-06-09T18:39:17.6925375Z Loading nanoCLR v1.9.1.0
2024-06-09T18:39:17.7519301Z Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
2024-06-09T18:39:17.7673329Z Repeat 2 times:
2024-06-09T18:39:17.7674415Z --------------------------------
2024-06-09T18:39:17.7676358Z    at nanoFramework.nanoCLR.Host.Interop.nanoCLR.nanoCLR_Run(nanoFramework.nanoCLR.Host.nanoCLRSettings)
2024-06-09T18:39:17.7678476Z --------------------------------
2024-06-09T18:39:17.7679618Z    at nanoFramework.nanoCLR.Host.nanoCLRHost.Run()
2024-06-09T18:39:17.7682988Z    at nanoFramework.nanoCLR.CLI.ExecuteCommandProcessor.ProcessVerb(nanoFramework.nanoCLR.CLI.ExecuteCommandLineOptions, nanoFramework.nanoCLR.CLI.VirtualSerialDeviceManager)
2024-06-09T18:39:17.7686204Z    at nanoFramework.nanoCLR.CLI.Program+<>c__DisplayClass9_1.<Main>b__2(nanoFramework.nanoCLR.CLI.ExecuteCommandLineOptions)
2024-06-09T18:39:17.7694292Z    at CommandLine.ParserResultExtensions.MapResult[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Int32, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](CommandLine.ParserResult`1<System.Object>, System.Func`2<System.__Canon,Int32>, System.Func`2<System.__Canon,Int32>, System.Func`2<System.__Canon,Int32>, System.Func`2<System.Collections.Generic.IEnumerable`1<CommandLine.Error>,Int32>)
2024-06-09T18:39:17.7700295Z    at nanoFramework.nanoCLR.CLI.Program+<>c__DisplayClass9_0.<Main>b__0()
2024-06-09T18:39:17.7701501Z    at nanoFramework.nanoCLR.CLI.Program.LogErrors(System.Action)
2024-06-09T18:39:17.7702633Z    at nanoFramework.nanoCLR.CLI.Program.Main(System.String[])
2024-06-09T18:39:20.5929808Z ...
2024-06-09T18:39:20.6020408Z ##[error]Process completed with exit code 1.

How to reproduce

https://github.com/CoryCharlton/nanoCLR_AccessViolationException/actions

Expected behaviour

nanoCLR should execute correctly.

Screenshots

No response

Aditional context

I'll try to spin up a Windows 2022 VM to see if it's specific to the OS or something to do with the GitHub hosted runner.

CoryCharlton commented 4 weeks ago

Confirmed that the issue presents itself in a clean install of Windows Server 2022 and is not specific to the GitHub Actions hosted runner:

image