-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Loading issue when RID is linux-musl-x64 on Alpine 3.15 #65152
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/area-meta Issue DetailsDescriptionWhen loading dependencies of PowerShell on Alpine 3.15, it falls back to load linux-x64 dependencies. The issue does not repro with alpine 3.14. In both cases, the SDK version is 6.0.0. It was found that the RID for Alpine 3.15 is missing on .NET 6 SDK. See: #62938 Note, dotnet --info does show the correct RID:
I have attached load trace logs for the powershell load failure. loadtrace.txt Excerpt below:
Reproduction StepsOn Alpine 3.15 container with .NET SDK dotnet tool install --global PowerShell Expected behaviorpwsh should execute correctly Actual behavior~/.dotnet/tools # ./pwsh https://aka.ms/powershell One or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.) Regression?No response Known WorkaroundsNo response Configuration.NET SDK 6.0.0 Other informationNo response
|
It's not a matter of defining the Alpine RID. The Alpine RID shouldn't need to be defined for things to work correctly. It should be falling back to the linux-musl RID. The SDK represents correctly but the loader is falling back to |
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsDescriptionWhen loading dependencies of PowerShell on Alpine 3.15, it falls back to load linux-x64 dependencies. The issue does not repro with alpine 3.14. In both cases, the SDK version is 6.0.0. It was found that the RID for Alpine 3.15 is missing on .NET 6 SDK. See: #62938 Note, dotnet --info does show the correct RID:
I have attached load trace logs for the powershell load failure. loadtrace.txt Excerpt below:
Reproduction StepsOn Alpine 3.15 container with .NET SDK dotnet tool install --global PowerShell Expected behaviorpwsh should execute correctly Actual behavior~/.dotnet/tools # ./pwsh https://aka.ms/powershell One or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.) Regression?No response Known WorkaroundsNo response Configuration.NET SDK 6.0.0 Other informationNo response
|
Backporting #62938 would fix this particular case, but I think @mthalman is also correct that the fallback logic in the host should handle MUSL based linuxes as special (it's too common not to). Basically we need to change this code here: runtime/src/native/corehost/hostmisc/pal.h Lines 66 to 87 in 26c9b28
It should have a branch for MUSL linux and return |
@vitek-karas - Since this issue shows up in 6.0, can we get it backported to that version? |
@agocke can you try to flow this through triage? That said, we shipped like this for a long time (probably ever since .NET 3.1) - so it's likely not that important. |
Sure, let’s give it a shot |
It seems to have revealed itself more so now, for some reason, with PowerShell. This was the original issue that identified this: PowerShell/PowerShell#16532. The issue showed up for .NET 6 but not for .NET 5 even though neither of them had the Alpine RID. |
Thanks @mthalman - that sounds like a strong enough argument to me to take it. Let's see... |
Description
When loading dependencies of PowerShell on Alpine 3.15, it falls back to load linux-x64 dependencies. The issue does not repro with alpine 3.14. In both cases, the SDK version is 6.0.0.
It was found that the RID for Alpine 3.15 is missing on .NET 6 SDK. See: #62938
Note, dotnet --info does show the correct RID:
I have attached load trace logs for the powershell load failure. loadtrace.txt
Excerpt below:
Reproduction Steps
On Alpine 3.15 container with .NET SDK
dotnet tool install --global PowerShell
~/.dotnet/tools/pwsh
Expected behavior
pwsh should execute correctly
Actual behavior
~/.dotnet/tools # ./pwsh
PowerShell 7.2.1
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
One or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.)
One or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.)
Cannot load PSReadline module. Console is running without PSReadline.
Process terminated. The type initializer for 'System.Management.Automation.PSObject' threw an exception.
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String[], Int32)
at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
System.TypeInitializationException: The type initializer for 'System.Management.Automation.PSObject' threw an exception.
---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Regression?
No response
Known Workarounds
No response
Configuration
.NET SDK 6.0.0
Alpine 3.15
Other information
No response
The text was updated successfully, but these errors were encountered: