Skip to content
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

deadlock in iisnode-debug header scenario concurrent with process recycle #277

Closed
tjanczuk opened this issue May 3, 2013 · 1 comment
Closed
Labels

Comments

@tjanczuk
Copy link
Owner

tjanczuk commented May 3, 2013

The following stack trace attempts to acquire slim lock for reading recursively, which deadlocks with another thread attempting to acquire that slim lock for writing. Slim locks cannot be called recursively on Windows: http://stackoverflow.com/questions/13064474/what-could-cause-a-deadlock-of-a-single-write-multiple-read-lock

slim lock for read:

>   iisnode.dll!CNodeProcessManager::GetActiveRequestCount() Line 416   C++
    iisnode.dll!CNodeApplication::GetActiveRequestCount() Line 143  C++
    iisnode.dll!CProtocolBridge::AddDebugHeader(CNodeHttpStoredContext * context) Line 1340 C++
    iisnode.dll!CProtocolBridge::ProcessResponseHeaders(unsigned long error, unsigned long bytesTransfered, _OVERLAPPED * overlapped) Line 1399 C++
    iisnode.dll!CProtocolBridge::ProcessResponseStatusLine(unsigned long error, unsigned long bytesTransfered, _OVERLAPPED * overlapped) Line 1254  C++
    iisnode.dll!CProtocolBridge::ContinueReadResponse(CNodeHttpStoredContext * context) Line 1198   C++
    iisnode.dll!CProtocolBridge::StartReadResponse(CNodeHttpStoredContext * context) Line 1114  C++
    iisnode.dll!CProtocolBridge::ReadRequestBodyCompleted(unsigned long error, unsigned long bytesTransfered, _OVERLAPPED * overlapped) Line 932    C++
    iisnode.dll!CProtocolBridge::ReadRequestBody(CNodeHttpStoredContext * context) Line 855 C++
    iisnode.dll!CProtocolBridge::SendHttpRequestHeadersCompleted(unsigned long error, unsigned long bytesTransfered, _OVERLAPPED * overlapped) Line 795 C++
    iisnode.dll!CProtocolBridge::SendHttpRequestHeaders(CNodeHttpStoredContext * context) Line 738  C++
    iisnode.dll!CProtocolBridge::CreateNamedPipeConnection(unsigned long error, unsigned long bytesTransfered, _OVERLAPPED * overlapped) Line 624   C++
    iisnode.dll!CProtocolBridge::InitiateRequest(CNodeHttpStoredContext * context) Line 532 C++
    iisnode.dll!CNodeProcess::AcceptRequest(CNodeHttpStoredContext * context) Line 356  C++
    iisnode.dll!CNodeProcessManager::Dispatch(CNodeHttpStoredContext * request) Line 127    C++
    iisnode.dll!CNodeApplication::Dispatch(IHttpContext * context, IHttpEventProvider * pProvider, CNodeHttpStoredContext * * ctx) Line 89  C++

slim lock for write:

    ntdll.dll!NtWaitForAlertByThreadId�()   Unknown
    ntdll.dll!RtlAcquireSRWLockExclusive�() Unknown
>   iisnode.dll!CNodeProcessManager::RecycleProcess(CNodeProcess * process) Line 182    C++
    iisnode.dll!CNodeProcess::OnProcessExited() Line 379    C++
    iisnode.dll!CNodeProcess::ProcessWatcher(void * arg) Line 323   C++
@tjanczuk
Copy link
Owner Author

tjanczuk commented May 4, 2013

Note: this is of relatively low severity: if can only happen only when iidnode-debug header is used and a race condition with process recycling occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant