locked
Setting TopMost causes paged pool kernel memory leak RRS feed

  • Question

  • We have an application that is required to keep one window top-most, even if other apps try to be top-most too. The app is .net, and sets Form.TopMost 4 times per second. This causes a leak in the kernel's paged pool when run on a Window 7 host w/ touch screen. The pool is exhausted after about 2.5 days and then the system is unusable.

    This problem is similar to the one fixed in KB 2582112, but that fix does not help.

    Our leak seems to caused by tiptsf.dll.

    A kernel debug stack trace is below. For this trace we have built a tiny un-managed (MFT) program that does nothing but call CWnd::SetWindowPos. So we've removed .net as the cause, but I can't find a forum for kernel memory leaks.

    ChildEBP RetAddr  Args to Child              
    9c393bd4 81c243e1 00000001 000001a0 734d6c41 nt!ExAllocatePoolWithTag+0x881
    9c393bfc 81abd194 00000001 000001a0 734d6c41 nt!AlpcpAllocateMessageFunction+0x18
    9c393c14 81c81405 81b4c1c0 84b931b0 81c53478 nt!ExAllocateFromPagedLookasideList+0x26
    9c393c20 81c53478 00280028 9c393cb8 81c54cac nt!AlpcpAllocateBlob+0x1f
    9c393c2c 81c54cac 9c393c94 df74e0a9 00000000 nt!AlpcpAllocateMessage+0x18
    9c393cb8 81c6a1e9 9c393ce8 0018ece4 00000000 nt!AlpcpSendMessage+0x228
    9c393d0c 81a538fa 00000110 00000000 0018ece4 nt!NtAlpcSendWaitReceivePort+0xfd
    9c393d0c 77c97094 00000110 00000000 0018ece4 nt!KiFastCallEntry+0x12a
    0018ec78 77c95424 6c272b75 00000110 00000000 ntdll!KiFastSystemCallRet
    0018ec7c 6c272b75 00000110 00000000 0018ece4 ntdll!NtAlpcSendWaitReceivePort+0xc
    0018ecb8 6c272aef 00000000 0018ece4 00000000 tiptsf!CAlpcClient::Internal_Send+0x77
    0018ecd8 6c287635 0018ece4 00280010 00004000 tiptsf!CAlpcClient::Send+0x16
    0018ed0c 6c27d4c9 001402dc 7ffdf6cc 00000000 tiptsf!SendZOrderChangeToTabTip+0x34
    0018ed50 6c280eb2 00000000 00000000 0018edb0 tiptsf!CaretCallWndProc+0x1b9
    0018ed70 76527a1a 00000000 00000000 0018edb0 tiptsf!TabletCallWndProc+0x21
    0018ed8c 76524999 00040000 00000000 0018edb0 USER32!DispatchHookW+0x33
    0018edc0 7652fe58 00578fe8 00000047 00000000 USER32!fnHkINLPCWPSTRUCTW+0x52
    0018ede8 77c96fce 0018ee00 00000030 0018f1dc USER32!__fnINLPWINDOWPOS+0x25
    0018ee2c 76531bd0 69e5f1aa 000b01de ffffffff ntdll!KiUserCallbackDispatcher+0x2e
    0018ee30 69e5f1aa 000b01de ffffffff 00000000 USER32!NtUserSetWindowPos+0xc
    0018ee58 0117399b 6a1d1968 00000000 00000000 mfc90ud!CWnd::SetWindowPos+0x6a [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winocc.cpp @ 322]
    0018ef50 69e60df2 00000000 00000176 00000004 settop_mfc!Csettop_mfcDlg::OnBnClickedOk+0x3b [c:\users\lkl3836\documents\visual studio 2008\projects\settop_mfc\settop_mfc\settop_mfcdlg.cpp @ 172]
    0018ef94 69e6153a 0018f8b8 00000001 00000000 mfc90ud!_AfxDispatchCmdMsg+0xb2 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 82]
    0018eff8 69e37283 00000001 00000000 00000000 mfc90ud!CCmdTarget::OnCmdMsg+0x2ea [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\cmdtarg.cpp @ 381]
    0018f034 69df9d64 00000001 00000000 00000000 mfc90ud!CDialog::OnCmdMsg+0x23 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 85]
    0018f098 69df8a09 00000001 000c0244 d66acb88 mfc90ud!CWnd::OnCommand+0x174 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2364]
    0018f1e8 69df8952 00000111 00000001 000c0244 mfc90ud!CWnd::OnWndMsg+0x79 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 1769]
    0018f208 69df5d70 00000111 00000001 000c0244 mfc90ud!CWnd::WindowProc+0x32 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 1755]
    0018f284 69df6336 0018f8b8 000b01de 00000111 mfc90ud!AfxCallWndProc+0xf0 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 240]
    0018f2a4 69df1a6b 000b01de 00000111 00000001 mfc90ud!AfxWndProc+0xa6 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 403]
    0018f2e0 7653c4e7 000b01de 00000111 00000001 mfc90ud!AfxWndProcBase+0x5b [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\afxstate.cpp @ 441]
    0018f30c 7653c5e7 69df1a10 000b01de 00000111 USER32!InternalCallWinProc+0x23
    0018f384 76534f0e 00000000 69df1a10 000b01de USER32!UserCallWinProcCheckWow+0x14b
    0018f3e0 76534f7d 00575648 00000111 00000001 USER32!DispatchClientMessage+0xda
    0018f408 77c96fce 0018f420 00000018 0018f5c4 USER32!__fnDWORD+0x24
    0018f434 76534f51 76530940 000b01de 00000111 ntdll!KiUserCallbackDispatcher+0x2e
    0018f438 76530940 000b01de 00000111 00000001 USER32!NtUserMessageCall+0xc
    0018f474 76535582 00575648 00000111 00000001 USER32!SendMessageWorker+0x546
    0018f494 74dd4601 000b01de 00000111 00000001 USER32!SendMessageW+0x7c
    0018f4b4 74dd4663 001f9658 00000000 000c0244 COMCTL32!Button_NotifyParent+0x3d
    0018f4d0 74dd44ed 50010001 00000001 0018f5ac COMCTL32!Button_ReleaseCapture+0x113
    0018f530 7653c4e7 000c0244 00000202 00000000 COMCTL32!Button_WndProc+0xa18
    0018f55c 7653c5e7 74d5b495 000c0244 00000202 USER32!InternalCallWinProc+0x23
    0018f5d4 7653cc19 00000000 74d5b495 000c0244 USER32!UserCallWinProcCheckWow+0x14b
    0018f634 7653cc70 74d5b495 00000000 0018f668 USER32!DispatchMessageWorker+0x35e
    0018f644 765341eb 001f34b8 7ffd6000 0018f7cc USER32!DispatchMessageW+0xf
    0018f668 69e5ead3 000b01de 00586f78 a02162aa USER32!IsDialogMessageW+0x588
    0018f680 69dff75e 001f34b8 0018f8b8 0018f6a8 mfc90ud!CWnd::IsDialogMessageW+0x73 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winocc.cpp @ 198]
    0018f690 69e3724f 001f34b8 0018f8b8 0018f8b8 mfc90ud!CWnd::PreTranslateInput+0x6e [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4332]
    0018f6a8 69dfaf8d 001f34b8 0018f8b8 000b01de mfc90ud!CDialog::PreTranslateMessage+0xef [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 80]
    0018f6bc 69e8743f 000b01de 001f34b8 0018f6dc mfc90ud!CWnd::WalkPreTranslateTree+0x8d [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 2946]
    0018f6d8 69e884f5 001f34b8 011802d8 0018f6f8 mfc90ud!AfxInternalPreTranslateMessage+0x4f [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 233]
    0018f6e8 69e874b5 001f34b8 011802d8 0018f718 mfc90ud!CWinThread::PreTranslateMessage+0x25 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 777]
    0018f6f8 69e872f1 001f34b8 0018f714 69df1c19 mfc90ud!AfxPreTranslateMessage+0x25 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 252]
    0018f718 69e888ce 011802d8 0018f730 69e87341 mfc90ud!AfxInternalPumpMessage+0xe1 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 178]
    0018f724 69e87341 011802d8 0018f758 69dff947 mfc90ud!CWinThread::PumpMessage+0xe [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 900]
    0018f730 69dff947 00000000 00000000 0018f8b8 mfc90ud!AfxPumpMessage+0x21 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\thrdcore.cpp @ 190]
    0018f758 69e382ec 00000004 d66acda4 0018f950 mfc90ud!CWnd::RunModalLoop+0x1d7 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\wincore.cpp @ 4386]
    0018f7c4 011722ed d61eda5f 00000000 00000000 mfc90ud!CDialog::DoModal+0x1ec [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dlgcore.cpp @ 584]
    0018f95c 69e0f554 cccccccc cccccccc cccccccc settop_mfc!Csettop_mfcApp::InitInstance+0xad [c:\users\xxx\documents\visual studio 2008\projects\settop_mfc\settop_mfc\settop_mfc.cpp @ 64]
    0018f980 011773ba 01160000 00000000 001e18aa mfc90ud!AfxWinMain+0x84 [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\winmain.cpp @ 37]
    0018f998 011738bb 01160000 00000000 001e18aa settop_mfc!wWinMain+0x1a [f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\appmodul.cpp @ 34]
    0018fa48 0117361f 0018fa5c 7692ed6c 7ffd6000 settop_mfc!__tmainCRTStartup+0x28b [f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 578]
    0018fa50 7692ed6c 7ffd6000 0018fa9c 77cb377b settop_mfc!wWinMainCRTStartup+0xf [f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 403]
    0018fa5c 77cb377b 7ffd6000 77ea0d44 00000000 kernel32!BaseThreadInitThunk+0xe
    0018fa9c 77cb374e 011717df 7ffd6000 00000000 ntdll!__RtlUserThreadStart+0x70
    0018fab4 00000000 011717df 7ffd6000 00000000 ntdll!_RtlUserThreadStart+0x1b
    


    • Moved by Mike Feng Thursday, April 11, 2013 8:36 AM
    Wednesday, April 10, 2013 3:32 PM

Answers

  • Do you know with what tool the form is made. However, because you show a enduser fix is probably the answer forum a better place to ask your question. MSDN means Microsoft Software Developers Network. So it assumed you know how the program is made and give with questions information about that. 

    http://answers.microsoft.com/en-us


    Success
    Cor

    • Proposed as answer by Mike Feng Thursday, April 11, 2013 8:36 AM
    • Marked as answer by Just Karl Wednesday, October 16, 2013 4:00 PM
    Thursday, April 11, 2013 6:03 AM