none
Leaking WDF objects (WdfTypeFile) for UMDF driver after Stop/disable RRS feed

  • Question

  • Hello ,

    I have trouble to pass the last WHCK test for my UMDF driver. I seems that some WDF file objects are open. See traces below. I have used WNDBG (attached to WUDFHost) and than disabled the driver.

    The problem here, that all file instances to UMDF driver closed successfully before and device IO operation are cancelled. In my UMDF driver I cannot do nothing more for OnCloseFile notfication. I'am helpless.

    regards

    elli

    **** WUDF DriverStop - Internal error 0x500000000000000
    **** in Host
    **** drivers\wdf\umdf\driverhost\framework\v1\wudf\wdfglobals.cpp:61(CWudfDriverGlobals::~CWudfDriverGlobals):
    Leaking WDF objects, use !wudfext.wudfdumpobjects 038DDFD8 to find the leaks, Context Record: .cxr 0x03D4EF54

    Set the ULONG @ 03D4EEE0 to 0 to continue execution.  Default is to terminate the process.
    The debugger command for this is "ed 03D4EEE0 0".
    (1b8.12cc): Break instruction exception - code 80000003 (first chance)
    *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\KERNELBASE.dll -
    eax=75a19068 ebx=00000100 ecx=0000001a edx=77e5f804 esi=77e3f774 edi=77e3f774
    eip=75a1906a esp=03d4eec0 ebp=03d4eec8 iopl=0         nv up ei pl nz na po nc
    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
    KERNELBASE!DebugBreak+0x2:
    75a1906a cc              int     3
    0:003> !wudfext.wudfdumpobjects 038DDFD8
    WdfTypeFile    Object: 0x03925fa0, Interface: 0x03925fe0
    WdfTypeFile    Object: 0x0392bfa0, Interface: 0x0392bfe0
    WdfTypeFile    Object: 0x03935fa0, Interface: 0x03935fe0
    WdfTypeFile    Object: 0x0393ffa0, Interface: 0x0393ffe0
    WdfTypeFile    Object: 0x03949fa0, Interface: 0x03949fe0
    WdfTypeFile    Object: 0x03953fa0, Interface: 0x03953fe0
    WdfTypeFile    Object: 0x0395dfa0, Interface: 0x0395dfe0
    WdfTypeFile    Object: 0x03969fa0, Interface: 0x03969fe0
    WdfTypeFile    Object: 0x03973fa0, Interface: 0x03973fe0
    WdfTypeFile    Object: 0x0397dfa0, Interface: 0x0397dfe0
    WdfTypeFile    Object: 0x03987fa0, Interface: 0x03987fe0


    • Edited by Elli_1 Tuesday, October 22, 2013 8:52 AM
    Tuesday, October 22, 2013 7:52 AM

Answers

  • '9 (--)' means that the last ref operation on the object was a release that brought the count down to 9, so it looks like there's a ref count problem. The full output of !wudfext.wudfrefhist should indicate where all these extra references were taken. Alternatively, you could put DebugBreak() calls in your code just before you use the WdfFileObject, and see if any unexpected references are taken on the object that you were unaware of.
    • Marked as answer by Elli_1 Tuesday, July 8, 2014 5:53 AM
    Wednesday, October 23, 2013 6:21 PM

All replies

  • Try !wudfext.wudfrefhist to get more clues about these objects.
    Tuesday, October 22, 2013 9:16 PM
  • OK, thanks. But I cannot see  real concrete  information for me.

    Last no least the history entrys shows  '9 (--)' for the last entry from wdfFileObject. What ever that means.
    I assume here is refcount problem. I know for each from my files  I have the same simple use case:

     - create
     - pending DeviceIoControl
     - cancel Request
     - close

    I can see the same behavior for the NetNfp Sample driver. The last entry shows here '10 (--).  Here is no other sample in WDK for dealing with many different file objectes at the same time and I cannot see  additional position in source code for a "Release()' call to update some reference counter.

    Not so funny, the WHCK stucks now for 7 and more different NFC chips.

    regards

    elli

    Wednesday, October 23, 2013 7:48 AM
  • '9 (--)' means that the last ref operation on the object was a release that brought the count down to 9, so it looks like there's a ref count problem. The full output of !wudfext.wudfrefhist should indicate where all these extra references were taken. Alternatively, you could put DebugBreak() calls in your code just before you use the WdfFileObject, and see if any unexpected references are taken on the object that you were unaware of.
    • Marked as answer by Elli_1 Tuesday, July 8, 2014 5:53 AM
    Wednesday, October 23, 2013 6:21 PM