Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Crash in XTPSkinManagerApiHook.cpp (383)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Crash in XTPSkinManagerApiHook.cpp (383)

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Crash in XTPSkinManagerApiHook.cpp (383)
    Posted: 03 February 2008 at 2:08am
I started my application for the 1000th time and got a crash at line 383 in XTPSkinManagerApiHook.cpp (version 11.2.2, VS 2008, MFC in shared DLL, _XTP_STATIC_LINK defined). I have not been able to reproduce the error. The only thing I remember is that I got a LOT of memory leaks in another DLL and decided to terminate the trace output (Shift+F5), after which I hit F5 immediately. Not sure if that can yield a problem, but still...
 
pszCalleeModName = "USER32.DLL"
pfnCurrent = 0x7e42f710
pfnNew = 0x0060c963 CXTPSkinManagerApiHook::OnHookSetScrollPos(struct HWND__ *,int,int,int) int (void)*
hmodCaller = 0x77c00000 {unused=??? } HINSTANCE__ *
I hope this call stack trace will give you a hint of what's going on:
 
  imagehlp.dll!76c941f4()  
  [Frames below may be incorrect and/or missing, no symbols loaded for imagehlp.dll] 
  imagehlp.dll!76c941c9()  
> MyProgram.exe!CXTPSkinManagerApiFunction::ReplaceInOneModule(const char * pszCalleeModName=0x01e9c294, int (void)* pfnCurrent=0x7e42f710, int (void)* pfnNew=0x0060c963, HINSTANCE__ * hmodCaller=0x77c00000)  Line 383 + 0x14 bytes C++
  MyProgram.exe!CXTPSkinManagerApiFunction::ReplaceInAllModules(const char * pszCalleeModName=0x01e9c294, int (void)* pfnCurrent=0x7e42f710, int (void)* pfnNew=0x0060c963)  Line 356 + 0x18 bytes C++
  MyProgram.exe!CXTPSkinManagerApiFunction::HookImport()  Line 324 + 0x1d bytes C++
  MyProgram.exe!CXTPSkinManagerApiHook::AddHook(XTPSkinFrameworkApiFunctionIndex nIndex=xtpSkinApiSetScrollPos, const char * pszCalleeModName=0x00a526c0, const char * pszFuncName=0x00a52890, int (void)* pfnOrig=0x7e42f710, int (void)* pfnHook=0x0060c963)  Line 183 C++
  MyProgram.exe!CXTPSkinManagerApiHook::HookImport(XTPSkinFrameworkApiFunctionIndex nIndex=xtpSkinApiSetScrollPos, const char * pszCalleeModName=0x00a526c0, const char * pszFuncName=0x00a52890, int (void)* pfnHook=0x0060c963)  Line 159 + 0x1c bytes C++
  MyProgram.exe!CXTPSkinManagerApiHook::InitializeHookManagement()  Line 513 C++
  MyProgram.exe!CXTPSkinManager::LoadSkin(const char * lpszResourcePath=0x00000000, const char * lpszIniFileName=0x00a33584)  Line 486 C++
  MyProgram.exe!CMainFrame::CMainFrame()  Line 72 C++
  MyProgram.exe!CMyProgramApp::InitInstance()  Line 167 + 0x39 bytes C++
  mfc90d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f14, int nCmdShow=1)  Line 37 + 0xd bytes C++
  MyProgram.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f14, int nCmdShow=1)  Line 30 C++
  MyProgram.exe!__tmainCRTStartup()  Line 574 + 0x35 bytes C
  MyProgram.exe!WinMainCRTStartup()  Line 399 C
  kernel32.dll!7c816fd7()  
  MyProgram.exe!CXTPCommandBars::_GetAddOrRemovePopup(CXTPToolBar * pToolBar=0x85ffecb6, CXTPCommandBar * pExpandBar=0x8b1974c0)  Line 1705 + 0x3e bytes C++
  d9e80000() 
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 13 February 2008 at 1:42pm
Happened again! Can you please investigate this?
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 29 February 2008 at 7:36am

Damn. It's becoming more frequent.

I hope you are aware of this bug! :/
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 31 March 2008 at 2:48am
It seems to happen more often when I do this:
 
F5, close program. F5, close program...
 
Perhaps the hook is not correctly uninitialized upon termination?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2008 at 1:52am
Hi,
 
Please download beta 12.0 and check if you can reproduce it.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2008 at 8:57pm

Unfortunately I get this crash in 12.0 too (at line 414). Though, it is very rare...

Back to Top
xhantt View Drop Down
Newbie
Newbie


Joined: 16 April 2008
Location: Argentina
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote xhantt Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2008 at 11:03am
I'm experiencing the same problem, it can be related to a call to ImageDirectoryEntryToData from different threads.

In the Remarks section of the MSDN documentation you can read

Quote All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.


I've added a critical section guarding this call, so far I don't have experienced the same crash again.


Back to Top
xhantt View Drop Down
Newbie
Newbie


Joined: 16 April 2008
Location: Argentina
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote xhantt Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2008 at 7:45pm
Almost, but I'm now experiencing another crash in the same function but only when is trying to hook mshtml.dll.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2008 at 12:43am

Hi,

Actually in 12.0 we have critical section in - CXTPLockGuard lock(m_pApiHook->m_cs);
 
You can exclude mshtml.dll. with
 
XTPSkinManager()->ExcludeModule("mshtml.dll");    // (for 12.0 )
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
xhantt View Drop Down
Newbie
Newbie


Joined: 16 April 2008
Location: Argentina
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote xhantt Quote  Post ReplyReply Direct Link To This Post Posted: 20 May 2008 at 11:19am
Thanks, I'll try to poll our PM to consider an upgrade.
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.141 seconds.