Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Intermittent crash in frame hook
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Intermittent crash in frame hook

 Post Reply Post Reply
Author
Message
ericgen34 View Drop Down
Newbie
Newbie


Joined: 16 July 2019
Location: Salisbury
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ericgen34 Quote  Post ReplyReply Direct Link To This Post Topic: Intermittent crash in frame hook
    Posted: 22 September 2020 at 5:03am
Hi, 

We keep having some intermittent crashes reported by customers that we cannot reproduce in dev. The call stack of a typical crash is shown below.

I wonder if someone has any idea what is going on? Or how we can start looking into this? We are using the framework normally as far as I know

Thank you!

Back to Top
ericgen34 View Drop Down
Newbie
Newbie


Joined: 16 July 2019
Location: Salisbury
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ericgen34 Quote  Post ReplyReply Direct Link To This Post Posted: 22 September 2020 at 5:05am
Apologies, the call stack screen shot didnt show. Here it is copied:

  KERNELBASE.dll!_RaiseException@16() Unknown
  VCRUNTIME140.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 129 C++
  mfc140u.dll!AfxThrowResourceException() Line 1347 C++
> mfc140u.dll!CWindowDC::CWindowDC(CWnd * pWnd) Line 1018 C++
  ToolkitPro1900vc150U.dll!CXTPCommandBarsFrameHook::RedrawFrame() Line 627 C++
  ToolkitPro1900vc150U.dll!CXTPCommandBarsFrameHook::OnHookMessage(HWND__ * hWnd, unsigned int nMessage, unsigned int & wParam, long & lParam, long & lResult) Line 1025 C++
  ToolkitPro1900vc150U.dll!CXTPHookManager::CHookSink::OnHookMessage(HWND__ * hWnd, unsigned int nMessage, unsigned int & wParam, long & lParam, long & lResult) Line 319 C++
  ToolkitPro1900vc150U.dll!CXTPHookManager::HookWndProc(HWND__ * hWnd, unsigned int message, unsigned int wParam, long lParam) Line 440 C++
  user32.dll!__InternalCallWinProc@20() Unknown
  user32.dll!UserCallWinProcCheckWow() Unknown
  user32.dll!DispatchClientMessage() Unknown
  user32.dll!___fnDWORD@4() Unknown
  ntdll.dll!_KiUserCallbackDispatcher@12() Unknown
  user32.dll!RealDefWindowProcWorker() Unknown
  user32.dll!RealDefWindowProcW() Unknown
  uxtheme.dll!_ThemeDefWindowProc() Unknown
  uxtheme.dll!_ThemeDefWindowProcW@16() Unknown
  user32.dll!DefWindowProcW() Unknown
  user32.dll!DefWindowProcWorker() Unknown
  user32.dll!DefDlgProcWorker() Unknown
  user32.dll!_DefDlgProcW@16() Unknown
  user32.dll!UserCallWinProcCheckWow() Unknown

Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2020 at 2:30am
Hello,

Unfortunately it is not clear what exactly is going wrong. Can you please provide more detailed information. If it cannot be re-produced in any of our sample applications provided I would appreciate you sending a sample application so that we could debug it.

Regards,
Artem Gontarenko
Back to Top
ericgen34 View Drop Down
Newbie
Newbie


Joined: 16 July 2019
Location: Salisbury
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ericgen34 Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2020 at 3:31am
Well, we cant reproduce it either, and the application is rather big, I cant really send a sample I'm afraid. I just wondered if there are specific areas to look into
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 891
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2020 at 5:47pm
It would appear the input window to the constructor is not a valid window during the entire call to the constructor. Are you threading? MFC isn't thread safe.

A lot can go on while this code executes:

    ASSERT(pWnd == NULL || ::IsWindow(pWnd->m_hWnd));

    if (!Attach(::GetWindowDC(m_hWnd = pWnd->GetSafeHwnd())))

The first line is only executed for debug builds. If you want to validate a window during release builds, you have to make the IsWindow call before calling the constructor. If a thread takes over while doing "m_hWnd = ...) no the m_hWnd could be bad before the call to Attach is made.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.