Application crashing on dhcpcsvc.dll with error code 0xc0000005 RRS feed

  • Question

  • Hi,

    I am getting the below error when trying to communicate in HTTP channel. The issue seems to be happening while receiving a response from the external system. The application that crashes is running on Windows Server 2008 R2 with .NET Framework 4.6 and Visual Studio C++ 2010 (x86), 2012 (x86) and 2013 (x64) redistributable packages. The application that communicates is a VC++ application. The server does not use DHCP communication, but the DHCP Client service is still running. The application that crashes uses Wininet which internally uses  dhcpcsvc.dll.

    Any help on the resolution would be of great help. Thanks in advance.

    Log Name:      Application
    Source:        Application Error
    Date:          11/29/2017 6:37:44 PM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      SSSSSS.SSSSSS.local
    Faulting application name: XXXX.exe, version:, time stamp: 0x57c3d5ad
    Faulting module name: dhcpcsvc.DLL, version: 6.1.7600.16385, time stamp: 0x4a5bd9b5
    Exception code: 0xc0000005
    Fault offset: 0x00001bf2
    Faulting process id: 0x4268
    Faulting application start time: 0x01d3696b0d6f25f2
    Faulting application path: C:\XXXX.exe
    Faulting module path: C:\windows\system32\dhcpcsvc.DLL
    Report Id: 4c15a132-d55e-11e7-a93e-509a4c6d3f1d
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <TimeCreated SystemTime="2017-11-29T23:37:44.000000000Z" />
        <Security />

    Thursday, November 30, 2017 9:46 PM

All replies

  • What does the source code of your program look like that is getting the error? What do you see in the debugger when the exception occurs? Is your program checking for errors? Probably not; you can get more meaningful information if your program checks for errors.

    The error is probably an access denied error, in case that helps. It is unlikely anyone can help without additional information so that is why the preceding is important.

    Sam Hobbs

    Thursday, November 30, 2017 10:34 PM
  • Hi Sreeram Rengarajan,

    thanks for posting here.

    Please provide more information about your issue. As Sam Hobbs said, this exception is an Access Violation. Since we don't have enough information, I suggest you try these ways below.

    1. Try to debug your application to find the caused statement. Starting in Visual Studio 2015 Update 1, the exception dialog box now explicitly names the pointer that caused the access violation. Here is a document about how to debug an Access Violation.


    2. Try to use CRT library to debug memory leak.


    3. Try to use tools like Windbg to analyze dump files if you get them.


    Hope this could be help of you.

    Best Regards,

    Baron Bi

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 1, 2017 7:50 AM
  • Just recently released :


    Though it is for Win10, it has something related:

    "reentrancy deadlock in WinHTTP.dll. This can result in the following: ....  Any application or service that relies on WinHTTP is impacted."

    -- pa

    Friday, December 1, 2017 3:08 PM
  • Here is the code snippet. The issue happens when we call HttpQueryInfo API in WinInet dll. The program does check for errors, but the issue seems to be happening even before that.

    void ReadResponse(LPDEVICE pDevice, BOOL bTackOnCANf)
    char szFunc[] = "ReadResponse";
    DWORD dwContentLength = 0;
    DWORD dwDataAvailable = 0;
    DWORD dwContentLengthSize = sizeof(dwContentLength);
    DWORD dwIndex = 0;
    DWORD dwBytesRead = 0;
    DWORD dwTotalRead = 0;
    DWORD dwResults = DE_SUCCESSFUL;

    LogPrintf(szLogFileName, "->%s(bTackOnCANf=%s)\n", szFunc, BoolCheck(bTackOnCANf));

    LogPrintf(szLogFileName, "  HttpQueryInfo(hHTTPRequest=%#lx, (CONTENT_LENGTH|FLAG_NUMBER))\n", pDevice->hHTTPRequest);
    if(!HttpQueryInfo(pDevice->hHTTPRequest, (HTTP_QUERY_CONTENT_LENGTH|HTTP_QUERY_FLAG_NUMBER), &dwContentLength, &dwContentLengthSize, &dwIndex))
    LogWININETErrors(szLogFileName, "HttpQueryInfo(HTTP_QUERY_CONTENT_LENGTH)", GetLastError());

    // EnterCriticalSection((LPCRITICAL_SECTION) &pDevice->csAsyncOpComplete);
    // LogPrintf(szLogFileName, "!CS_LOCK!\n");

    // Reset AsyncOpComplete Event as a WriteToDevice() will not issue a WAITFOR...() on it!
    LogPrintf(szLogFileName, "  ResetEvent(hAsyncOpCompleteEvent)\n");

    Friday, December 1, 2017 3:37 PM
  • We also found that the customer had two Network Interface Cards with one unplugged. We have disabled this, but not sure if this would resolve the issue. Any ideas?

    Thanks for the response.

    Friday, December 1, 2017 3:38 PM
  • You don't show where dwContentLengthSize is used but the following looks suspicious:

    DWORD dwContentLengthSize
    = sizeof(dwContentLength);

    Even if that is not the problem, if that is incorrect then the problem can be caused by something like that. The reason I say it is suspicious is that it is unlikely a function needs to know how long a DWORD is so it is likely that the incorrect value is used here.

    Sam Hobbs

    Friday, December 1, 2017 7:47 PM