.net core 7 support
We are on 2022.3, and having a memory leak, but since we are on dotnet 7, we cannot use the console application to get a snapshot.
Running on ubuntu: dotnet dotMemory.exe get-snapshot 16251
We get:
Unable to start profiling. Unable to read beyond the end of the stream.
We've tried running it on Windows too, and we get other errors.
In some rare occasions it randomly attaches to the process but then it crashes the process before it can get a snapshot.
So: When will .net core 7 be supported?
Please sign in to leave a comment.
Hello,
.NET 7 has several known issues relates to profiling API which should be fixed in runtime itself.
Could you please collect dotMemory logs? you can enable logs from command line:
Log files will be located in the JetLogs folder in user's temp directory.
Please collect logs on Windows and on Ubuntu machines.
Hi,
We've reproduced this issue in our environment. This is a known issue in dotnet runtime: https://github.com/dotnet/runtime/issues/78831
We hope this fix will be available in the next .NET version (7.0.2).
What error occurs on getting the snapshot? Could you please provide requested logs for this case?
HI,
Dotnet runtime already public 7.0.2 version, but the question still stands(multiple runs has a probability of crash).
Please help to locate this problem
Hello,
We’ve verified described issue (https://github.com/dotnet/runtime/issues/78831) and attach works properly in our environment if .net 7.0.2 runtime is installed. Could you please type dotnet –version in command line to check which dotnet version is installed? Please send us console output.
It looks like you experience some other issue. Could you please configure automatic crash dumps collection on your machine:
Windows
Download the procdump utility: https://docs.microsoft.com/en-us/sysinternals/downloads/procdump
Unpack it to any folder, e.g. “C:\Program Files”
Run cmd as administrator and go to procdump folder
Enter command procdump.exe -i <Path to crash dump folder> -ma
Attach dotMemory and wait profiled application crashes;
Find a newly created dump in <Path to crash dump folder> directory and share with us via https://uploads.jetbrains.com/ form.
Linux
The location of core dumps is specified in the `/proc/sys/kernel/core_pattern`, please be sure it will not be piped to another program by `|/path/to/program` pattern, otherwise you have to reconfigure it to /tmp directory using echo "/tmp/core.%e.%p" > /proc/sys/kernel/core_pattern (should be executed in root console, type sudo -i to enter), and restore the previous core_pattern later;
Type exit to exit root console if you use it;
Check the directory specified in your core_pattern file (usually it is /tmp/ or current working directory);
Run the command ulimit -c unlimited in user console and run your application from exactly this console;
Attach dotMemory and wait profiled application crashes;
Find a newly created dump in the appropriate directory and share with us via https://uploads.jetbrains.com/ form.
Hi Anna Guseva:
Thank you for your prompt reply, I'm so sorry for replying to you late.
dotnet build --debug -r linux-x64 --self-contained true --source https://nuget.cdn.azure.cn/v3/index.json -o /app Server/Server.csproj
Launch app:
/app/Server --args
The usage of Dotmemory is as follows:
Execute the following "ExecCMD" method via http access, and it will launch the ".sh" script, To expose the problem faster, access http every 2 minutes during testing.
The error log is as follows:
{ "date": "2023-01-23T23:28:01.581", "log_level": "debug", "caller": "CMD.cs:164", "message": "agent execCMD success: command: /app/dotMemory.sh, output: " }
{ "date": "2023-01-23T23:28:01.581", "log_level": "debug", "caller": "Agent.cs:124", "message": "CMD exec sh dotMemory.sh, tpMsg: " }
cannot create thread specific key for __cxa_get_globals()
---
Unable to start profiling. Unable to read beyond the end of the stream.
Aborted (core dumped)
Attach is the coredump file, please review it.
The file download: https://livetopiam-hot.s3.us-west-2.amazonaws.com/Coredump/core.Server.31854
Thank you for your patience and cooperation, If you have any questions or concerns, don't hesitate to let me know.
Thank you for information, we'll investigate this dump. You're welcome to follow corresponding ticket.
Look forward to your feedbacks and suggestions soon, I tested "dotTrace" again and it worked.
After my repeated tests over the last few days, run the Dotmemory at every 2 mimute like below:
there will be a crash in 36 hours. the question is reproducible, the following error is reported:
Hope the above information is useful to you, your kind assistance on this are very much appreciated.
Hi!
As mentioned here, the problem relates to C++ toolset. This task requires huge investigation and won't be solved in a short time. You're welcome to vote for and follow this ticket to get any updates on it.
As a workaround, we can suggest you not to attach every 2 minutes but use triggers to get memory snapshots:
./dotmemory attach $pid --trigger-timer=2m
You can also specify some other parameters to control profiling session, e.g., profiling session timeout, use ./dotmemory help attach to read help. As a result, you'll get a single workspace file with collected snapshots.
If this use case is not suitable for you, could you please describe your scenario in details? Why do you perform profiling this way (I mean attaching every 2 minutes)?