question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.22 Deadlock still present (possibly from ASM functionality)

See original GitHub issue

Describe the bug 2.22 deadlocking similarly to #3625, possibly related to ASM (see below)

To Reproduce Random (possibly timebased, slow exhaustion of resources?)

Expected behavior For our the application to not hard deadlock 😂

Screenshots image

Runtime environment (please complete the following information):

  • Nuget package + App service extension (Azure)
  • 2.22.0, same issue in 2.21.0
  • Windows running on Azure App Service
  • NET Framework 4.7.2

Additional context

Since we started using datadog we found that our instrumented app would randomly stop responding to requests with response times up to 5+ minutes and would require a hard restart, we enabled ASM as soon as we got APM running for our app.

Initially thought to be related to #3625 , the following steps were taken: DD_PROFILING_ENABLED = 0 - the issue would still occur randomly. thought to be a version mismatch between extension 2.22.0 and nuget version 2.21.0, ugprading to 2.22 to match the extension didn’t resolve the issue. Now removed DD_APSEC_ENABLED = 1 - so far no hard lock (24h+)

Dump file of an uncaught / not manually restarted instance.

========================================================
 Dump Analysis for <redacted>
 ========================================================
Below is the list of all the threads active in the process
{
  "CallStack": [
    "ntdll!NtDelayExecution+0xc",
    "KERNELBASE!SleepEx+0x8a",
    "clr!EESleepEx+0x52",
    "clr!CExecutionEngine::ClrSleepEx+0xe",
    "clr!ClrSleepEx+0x1d",
    "clr!Thread::UserSleep+0xbb",
    "clr!CRWLock::StaticAcquireReaderLock+0x1ae",
    "clr!CRWLock::StaticAcquireReaderLockPublic+0x8f",
    "Datadog.Trace.AppSec.Concurrency.ReaderWriterLock.EnterReadLock()",
    "Datadog.Trace.AppSec.Waf.Context.GetContext(IntPtr, Datadog.Trace.AppSec.Waf.Waf, Datadog.Trace.AppSec.Concurrency.ReaderWriterLock, Datadog.Trace.AppSec.Waf.NativeBindings.WafLibraryInvoker)",
    "Datadog.Trace.AppSec.Waf.Waf.CreateContext(Datadog.Trace.AppSec.Concurrency.ReaderWriterLock)",
    "Datadog.Trace.AppSec.Coordinator.SecurityCoordinator.RunWaf(System.Collections.Generic.Dictionary`2<System.String,System.Object>)",
    "Datadog.Trace.AppSec.Coordinator.SecurityCoordinator.CheckAndBlock(System.Collections.Generic.Dictionary`2<System.String,System.Object>)",
    "Datadog.Trace.AspNet.TracingHttpModule.OnEndRequest(System.Object, System.EventArgs)",
    "System.Web.HttpApplication+SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()",
    "System.Web.HttpApplication+<>c__DisplayClass285_0.<ExecuteStepImpl>b__0()",
    "System.Web.HttpApplication+StepInvoker.Invoke(System.Action)",
    "System.Web.HttpApplication+StepInvoker+<>c__DisplayClass4_0.<Invoke>b__0()",
    "System.Web.HttpApplication+<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0(System.Action)",
    "System.Web.HttpApplication+StepInvoker.Invoke(System.Action)",
    "System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep)",
    "System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)",
    "System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception)",
    "System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, System.AsyncCallback)",
    "System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext)",
    "System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)",
    "System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)",
    "webengine4!W3_MGD_HANDLER::ProcessNotification+0x62",
    "webengine4!W3_MGD_HANDLER::DoWork+0x32a",
    "webengine4!RequestDoWork+0x3a7",
    "webengine4!CMgdEngHttpModule::OnEndRequest+0x18",
    "iiscore!NOTIFICATION_CONTEXT::RequestDoWork+0x2e3",
    "iiscore!NOTIFICATION_CONTEXT::CallModulesInternal+0x4af",
    "iiscore!NOTIFICATION_CONTEXT::CallModules+0x2b",
    "iiscore!NOTIFICATION_MAIN::DoWork+0x105",
    "iiscore!W3_CONTEXT_BASE::ContinueNotificationLoop+0x32",
    "iiscore!W3_CONTEXT_BASE::IndicateCompletion+0xa0",
    "webengine4!W3_MGD_HANDLER::IndicateCompletion+0x45",
    "webengine4!MgdIndicateCompletion+0x22",
    "DomainBoundILStubClass.IL_STUB_PInvoke(IntPtr, System.Web.RequestNotificationStatus ByRef)",
    "System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)",
    "System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)",
    "clr!UM2MThunk_Wrapper+0x76",
    "clr!Thread::DoADCallBack+0xbc",
    "clr!UM2MDoADCallBack+0x92",
    "webengine4!W3_MGD_HANDLER::ProcessNotification+0x62",
    "webengine4!ProcessNotificationCallback+0x33",
    "picohelper!DllMain+0x6c26",
    "clr!UnManagedPerAppDomainTPCount::DispatchWorkItem+0x1a4",
    "clr!ThreadpoolMgr::ExecuteWorkRequest+0x4f",
    "clr!ThreadpoolMgr::WorkerThreadStart+0x36c",
    "clr!Thread::intermediateThreadProc+0x58",
    "kernel32!BaseThreadInitThunk+0x24",
    "ntdll!__RtlUserThreadStart+0x2f",
    "ntdll!_RtlUserThreadStart+0x1b"
  ],
  "Count": 461

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Reciocommented, Feb 10, 2023

I’ll do it on Monday, don’t really wanna have to support the idea of getting an email or slack alert in the back of my mind during the weekend

I’ll keep you posted tho, promise 🤞

0reactions
andrewlockcommented, Mar 16, 2023

That’s great, thanks for the follow up @Recio!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance degradation in 2.21.0 · Issue #3625
@Recio Yeah the fix in 2.22 was for a deadlock on linux. ... 2.22 Deadlock still present (possibly from ASM functionality) #3773.
Read more >
Untitled
... 2.22 Deadlock still present (possibly from ASM functionality) #3773 https://docs.datadoghq.com/account_management/saml/azure/ ...
Read more >
2 Automatic Storage Management
This chapter provides information about the Automatic Storage Management (ASM) metrics.
Read more >
Sound Deadlock Prediction
Our results: We present the first sound deadlock predictor for Java. It uses request events and a novel form of executability constraints. We...
Read more >
[syzbot] [can?] possible deadlock in j1939_sk_errqueue (2)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found