question

MohammadBhaji-5487 avatar image
0 Votes"
MohammadBhaji-5487 asked prmanhas-MSFT commented

.Net Core 3.1 Based Stand alone Web API is crashing with stack overflow exception due to the KERNELBASE.dll

I have a .Net Core 3.1 based Web API created as a standalone package MyApp.exe and installed in a windows based container. Only in certain container instances the WebAPI process MyApp.exe getting crashed randomly. From the application it is not logging any errors. But with the crash Dump got the below information. In the Web API, I am not using any recursive calls there is no possibility of stack overflow exception should occur. What could possibly be the reason for the crash?

Note: I am able to see some crashes of powershell.exe with the information of KERNELBASE.dll in the same container

The Dump file content Unhandled exception at 0x00007FFB2B4456CE (KERNELBASE.dll) in MyApp.exe.dmp: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000002E8983EF78).

KERNELBASE.dll!ConsoleCallServerGeneric() Unknown
KERNELBASE.dll!ConsoleCallServer() Unknown
KERNELBASE.dll!SetTEBLangID() Unknown
KERNELBASE.dll!_KernelBaseBaseDllInitialize() Unknown
KERNELBASE.dll!KernelBaseDllInitialize() Unknown
ntdll.dll!LdrpCallInitRoutine() Unknown
ntdll.dll!LdrpInitializeThread() Unknown
ntdll.dll!_LdrpInitialize() Unknown
ntdll.dll!LdrInitializeThunk()

dotnet-runtimeazure-container-instancesservice-fabric-standalone
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is it possible you have a property that uses backing fields? Take this example


      public string FirstName
      {
          get => firstName;
          set
          {
                 if (string.IsNullOrWhiteSpace(value))
                    throw new ArgumentException("First name must not be blank");
                 firstName = value;
          }
      }
     private string firstName;

If you accidently change firstName = value to FirstName = value in the set it will cause a stack overflow

0 Votes 0 ·

HI @vb2ae . Thanks for replying.

We are not having this type of code handling anywhere in our project. My doubt is it is not just my application even powershell app also got crashed with the logs stating that KERNELBASE.dll with the similar type of issue. so is this a common bug in microsoft components or is it specific to .NET CORE.

0 Votes 0 ·
prmanhas-MSFT avatar image prmanhas-MSFT PrabhuJanakiraman-1943 ·

@PrabhuJanakiraman-1943 Apologies for the delay in response and all the inconvenience caused because of the issue.

Can you please confirm if you are still facing the same issue?

Thanks

0 Votes 0 ·
Show more comments

0 Answers