Repository navigation
Closed
Description
root@586646e9dfd4:~/.dotnet/tools# ./dotnet-dump collect -p 1
Writing full to /root/.dotnet/tools/core_20200423_113305
Complete
root@586646e9dfd4:~/.dotnet/tools# ./dotnet-dump analyze core_20200423_113305
Loading core dump: core_20200423_113305 ...
Ready to process analysis commands. Type 'help' to list available commands or 'help [command]' to get detailed help on a command.
Type 'quit' or 'exit' to exit the session.
Unhandled exception: System.ArgumentOutOfRangeException: Count cannot be less than zero. (Parameter 'count')
at System.String.Ctor(Char c, Int32 count)
at Microsoft.Diagnostics.Repl.ConsoleProvider.ClearLine() in /_/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs:line 250
at Microsoft.Diagnostics.Repl.ConsoleProvider.RefreshLine() in /_/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs:line 308
at Microsoft.Diagnostics.Repl.ConsoleProvider.Start(Func`3 dispatchCommand) in /_/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs:line 86
at Microsoft.Diagnostics.Tools.Dump.Analyzer.Analyze(FileInfo dump_path, String[] command) in /_/src/Tools/dotnet-dump/Analyzer.cs:line 111
at System.CommandLine.Invocation.CommandHandler.GetResultCodeAsync(Object value, InvocationContext context)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseParseErrorReporting>b__22_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseSuggestDirective>b__7_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseParseDirective>b__6_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseHelp>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass4_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<<RegisterWithDotnetSuggest>b__23_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass5_0.<<UseExceptionHandler>b__0>d.MoveNext()
Activity
hoyosjs commentedon Apr 23, 2020
Hey @smokedog2, quick few questions:
In this case I see that the dump was loaded and we are starting to use the console provider, we are trying to clear the command line to refresh it. We are allocating a string of however many spaces are necessary to fill the console width in here https://github.com/dotnet/diagnostics/blob/master/src/Microsoft.Diagnostics.Repl/Console/ConsoleProvider.cs#L250 @mikem8361 can you think of any reason the console width would be 0 or less? I know if
Console.IsRedirectedOutputis true, then this is not well defined anddotnet runused to make this happen (sometimes it ended up in an exception, others not quite). The only case I could find for a WindowWidth of 0 was in the native side of the libraries, inSystemNative_GetWindowSizewhen we compile for targets with no ioctl or that have an absence ofTIOCGWINSZas an option for ioctl. This code hasn't changed in 4 years.smokedog2 commentedon Apr 23, 2020
First of all, thank you very much for your answers.
Please forgive me, my English is very bad.
My application is running in a container. I recently encountered a strange problem. The application in the container sometimes stopped responding. It may be a few days or weeks. Check the resource usage through docker stats and found that the resource usage is very low. CPU Basically around 0.01%, the memory usage is also normal. But there is no response to the request, and this problem can be solved by restarting the container, so I try to analyze the dump process, and if necessary, I can provide a dump file.
Host environment: centos7.4
docker version: 17.12.0-ce
dockerfile:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS runtime
WORKDIR / app
ENV TZ = Asia / Shanghai
RUN ln -snf / usr / share / zoneinfo / $ TZ / etc / localtime && echo $ TZ> / etc / timezone
COPY..
ENTRYPOINT ["dotnet", "app.dll"]
mikem8361 commentedon Apr 23, 2020
I have no idea why Console.WindowWidth <= 0, but maybe the console code should check and not clear the line. This code has been around a long time and haven't seem any problems like this.
smokedog2 commentedon May 6, 2020
Today my application stopped responding again. I tried to dump the file, but it stuck there while executing the command, and I waited for almost an hour. I also tried the dotnet-counters monitor and it kept loading.
This is my dump command
root @ 3d1396aa4c62: ~ / .dotnet / tools # ./dotnet-dump collect -p 1
Writing full to /root/.dotnet/tools/core_20200506_092637
This is the resource usage monitored by docker stats
3d1396aa4c62 myapp 0.02% 502.5MiB / 47.01GiB 1.04% 23.3GB / 45.6GB 115MB / 1.54GB 88
Any suggestions?
smokedog2 commentedon May 13, 2020
It may be due to errors caused by environmental problems, I can analyze the dump on other machines. I will continue to investigate the problem that the program stops responding.