-
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
Core dump is not created on OOM exceptions in Docker even though COMPlus_DbgEnableMiniDump is set to 1 #52521
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: @tommcdon Issue DetailsSteps to reproduceRun the mcr.microsoft.com/dotnet/sdk:5.0.202-alpine3.13-amd64 docker image with a memory limit and privileged capabilites:
Inside the container, create a new app:
Change App/Program.cs to the following: using System;
using System.Collections.Generic;
namespace App
{
class Program
{
static void Main(string[] args)
{
var l = new List<byte[]>();
while (true)
{
l.Add(new byte[1024 * 1024 * 1024]);
}
}
}
} Publish the application:
Run the following:
Run the executable:
As expected, we get an "out of memory" exception. However, a core dump is not created. It appears that Configuration
Inside the container:
|
cc @mikem8361 |
From the app_output.txt it looks like createdump is getting launched but it gets killed in the middle of the dump generation because of Linux's OOM-killer. Could you try to disable it and run this again? |
|
This issue has been automatically marked |
The default value of /proc/sys/vm/panic_on_oom appears to be 0. I tried setting it to both 0 and 1 and running run with panic_on_oom set to 0.txt |
Yes, it does look like in both cases, createdump is aborted. It seems that createdump is still being aborted by the OOM killer. It also could be aborting itself when a memory allocation fails but that would be a crash/exception/signal. Not sure what to do about it in either case. |
/cc: @hoyosjs |
I don't know the details but I was told that it is hard to turn off the OOM killer. The above directions I found on the internet. I don't have any experience with it. |
Moving this to 7.0.0 because there is nothing we can do in createdump to prevent it from being killed in low memory scenarios |
Steps to reproduce
Run the mcr.microsoft.com/dotnet/sdk:5.0.202-alpine3.13-amd64 docker image with a memory limit and privileged capabilites:
Inside the container, create a new app:
Change App/Program.cs to the following:
Publish the application:
Run the following:
Run the executable:
As expected, we get an "out of memory" exception. However, a core dump is not created. It appears that
createdump
starts running but doesn't finish. The following file contains the on-screen output: app_output.txtConfiguration
Inside the container:
The text was updated successfully, but these errors were encountered: