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

System.OutOfMemoryException during installation dotnet-sos, dotnet-symbol, dotnet-dump for linux-riscv64 #4495

Open
ww898 opened this issue Feb 3, 2024 · 6 comments
Labels

Comments

@ww898
Copy link
Contributor

ww898 commented Feb 3, 2024

Hi there,

I got the expection for dotnet tool install --global dotnet-sos on linux-riscv64 with 7.75Gb RAM :

$ dotnet tool install --global dotnet-sos
Skipping NuGet package signature verification.
Unhandled exception: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Reflection.Emit.RuntimeTypeBuilder.<SetMethodIL>g____PInvoke|7_0(QCallModule __module_native, Int32 __tk_native, Int32 __isInitLocals_native, Byte* __body                      _native, Int32 __bodyLength_native, Byte* __LocalSig_native, Int32 __sigLength_native, Int32 __maxStackSize_native, ExceptionHandler* __exceptions_native, Int32 __numE                      xceptions_native, Int32* __tokenFixups_native, Int32 __numTokenFixups_native)
   at System.Reflection.Emit.RuntimeTypeBuilder.CreateTypeNoLock()
   at System.Reflection.Emit.RuntimeTypeBuilder.CreateTypeInfoImpl()
   at System.Reflection.Emit.RuntimeTypeBuilder.CreateTypeInfoCore()
   at System.Xml.Serialization.XmlSerializationReaderILGen.GenerateEnd()
   at System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types)
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location)
   at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace, String location)
   at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
   at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
   at System.Xml.Serialization.XmlSerializer..ctor(Type type)
   at Microsoft.DotNet.ToolPackage.ToolConfigurationDeserializer.Deserialize(String pathToXml) in /_/src/Cli/dotnet/ToolPackage/ToolConfigurationDeserializer.cs:line 1                      9
   at Microsoft.DotNet.ToolPackage.ToolPackageInstance.DeserializeToolConfiguration(LockFileTargetLibrary library) in /_/src/Cli/dotnet/ToolPackage/ToolPackageInstance                      .cs:line 207
   at Microsoft.DotNet.ToolPackage.ToolPackageInstance.GetToolConfiguration() in /_/src/Cli/dotnet/ToolPackage/ToolPackageInstance.cs:line 131
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.DotNet.ToolPackage.ToolPackageInstance.GetCommands() in /_/src/Cli/dotnet/ToolPackage/ToolPackageInstance.cs:line 88
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.DotNet.ToolPackage.ToolPackageInstance.get_Commands() in /_/src/Cli/dotnet/ToolPackage/ToolPackageInstance.cs:line 40
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallGlobalOrToolPathCommand.Execute() in /_/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCom                      mand.cs:line 155
   at Microsoft.DotNet.Tools.Tool.Install.ToolInstallCommand.Execute() in /_/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallCommand.cs:line 51
   at Microsoft.DotNet.Cli.ToolInstallCommandParser.<>c.<ConstructCommand>b__17_0(ParseResult parseResult) in /_/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstal                      lCommandParser.cs:line 98
   at System.CommandLine.Invocation.AnonymousCliAction.Invoke(ParseResult parseResult)
   at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
   at System.CommandLine.ParseResult.Invoke()
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in /_/src/Cli/dotnet/Program.cs:line 227
@ww898 ww898 changed the title System.OutOfMemoryException during installation dotnet-sos for linux-riscv64 System.OutOfMemoryException during installation dotnet-sos, dotnet-symbol, dotnet-dump for linux-riscv64 Feb 3, 2024
@hoyosjs hoyosjs added the enhancement New feature or request label Feb 6, 2024
@hoyosjs
Copy link
Member

hoyosjs commented Feb 6, 2024

We currently don't support sos and dump on riscv. As for global tools, this would be the SDK work more than diagnostics.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 7, 2024

@akoeplinger @steveisok do y'all know what the mono SDK support here is and who'd look at refemit in that case?

@steveisok
Copy link
Member

@akoeplinger @steveisok do y'all know what the mono SDK support here is and who'd look at refemit in that case?

As far as I know, we don't have a riscv runtime with mono.

@akoeplinger
Copy link
Member

Yeah this is running on coreclr.

@hoyosjs
Copy link
Member

hoyosjs commented Feb 8, 2024

Oh, sorry. Forget riscv is coreclr based. Thanks folks. That being said, this is an SDK tool issue. Let me ask what the state of SDK is currently.

@akoeplinger
Copy link
Member

You might be able to workaround by changing this here to always return SerializationMode.ReflectionOnly so XmlSerializer skips generating the temp assembly: https://github.com/dotnet/runtime/blob/0a5e97f46fb4ddf4f0ec41889243ed99e704fa95/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs#L118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants