-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.AccessViolationException when using current version (68.2.0.9) of Microsoft.ICU.ICU4C.Runtime with .NET SDK v6.0.402 #77045
Comments
Tagging subscribers to this area: @dotnet/area-system-globalization Issue DetailsDescriptionHi we are having issues with ICU after installing the new .NET 6 SDK v6.0.402 We are using up to date versions of Windows 10 and Windows 11 and the same error happens on both with the latest .NET SDK updates. If ICU settings are disabled everything behaves as normal Reproduction StepsSetup a new .NET 6 console project with the following files Repro.csproj <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" />
</ItemGroup>
</Project> Program.cs using System.Globalization;
CultureInfo.GetCultureInfo("en-US").CompareInfo.Compare("sample", "Sample", CompareOptions.IgnoreSymbols); Expected behaviorNo System.AccessViolationException are thrown and the program exists with status code 0 Actual behaviorSystem.AccessViolationException is thrown or Windows Security Exploit Protection kills the program if Control flow guard (CFG) is enabled Regression?With the previous version of the SDK everything worked as espected Known WorkaroundsRemove ICU settings Configuration.NET SDK v6.0.402 Other informationNo response
|
Thanks @ThomasSkyldahl for reporting it. I'll work on fixing it. |
@ThomasSkyldahl I already have the PRs out for the fix but I want to learn more about your scenario. Didn't you discover this issue from already deployed app? or you are building a new app/service and run into the issue? Also, are you willing to upgrade to .NET 7.0? My question mostly to understand the timing till we release the fix. |
We are in the process of upgrading a .NET Framework Umbraco 8 installation to .NET 6 + Umbraco 10. My guess is that Umbraco adds ICU with AppLocal to get consistant CultureInfo naming cross platform as they use CultureInfo.GetCultures() And in our case we use it with Hangfire and inside hangfire they use Dapper and it uses Microsoft.Data.SqlClient or the old one and its inside their data mapping the Comparer failed For us it shouldn't be a problem to wait for a .NET 6 release alongside the .NET 7 release |
Thanks for the info @ThomasSkyldahl. As a workaround for now, you may downgrade to .NET 6.0.9 till we release the fix. |
For clarity, is this issue dependent on the version of the .NET SDK used to build the code, or the version of the .NET runtime used to run the code? Asking because I'm running stuff in Azure App Service, which doesn't seem to have fine-grained control over the .NET runtime version. Is there a workaround in that case, if I want to stick to app-local ICU? |
@cmeeren It will depend on the installed .NET runtime. You have the option to publish your service/app with the runtime included https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish with |
We have merged all servicing PRs. Closing the issue. |
@tarekgh Just as some feedback on timing: this was introduced in production apps, the platform upgraded the .net version and downgrading is not possible. So we're relying on a new .net 6 version to be released to get the platform upgraded again. Thanks for your consideration! |
@nul800sebastiaan thanks for the feedback. The fix will be in the next .NET 6.0 service release. |
Description
Hi we are having issues with ICU after installing the new .NET 6 SDK v6.0.402
using specific Compare options fails with System.AccessValidationException
We are using up to date versions of Windows 10 and Windows 11 and the same error happens on both with the latest .NET SDK updates.
If ICU settings are disabled everything behaves as normal
Reproduction Steps
Setup a new .NET 6 console project with the following files
Repro.csproj
Program.cs
Expected behavior
No System.AccessViolationException are thrown and the program exists with status code 0
Actual behavior
System.AccessViolationException is thrown or Windows Security Exploit Protection kills the program if Control flow guard (CFG) is enabled
Regression?
With the previous version of the SDK everything worked as espected
Known Workarounds
Remove ICU settings
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" />
Configuration
.NET SDK v6.0.402
.NET Runtime v6.0.10
Architecture: x64
Windows 10 and 11 both fully updated
Specific on my machine: Version 21H2 (OS Build 190444.2130)
Other information
No response
The text was updated successfully, but these errors were encountered: