Print Page | Close Window

Crash in XTPSkinManagerApiHook.cpp (383)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=9480
Printed Date: 23 November 2024 at 6:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Crash in XTPSkinManagerApiHook.cpp (383)
Posted By: znakeeye
Subject: Crash in XTPSkinManagerApiHook.cpp (383)
Date 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() 



Replies:
Posted By: znakeeye
Date Posted: 13 February 2008 at 1:42pm
Happened again! Can you please investigate this?


Posted By: znakeeye
Date Posted: 29 February 2008 at 7:36am

Damn. It's becoming more frequent.

I hope you are aware of this bug! :/


Posted By: znakeeye
Date 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?


Posted By: Oleg
Date 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


Posted By: znakeeye
Date Posted: 17 May 2008 at 8:57pm

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



Posted By: xhantt
Date 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.




Posted By: xhantt
Date 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.


Posted By: Oleg
Date 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


Posted By: xhantt
Date Posted: 20 May 2008 at 11:19am
Thanks, I'll try to poll our PM to consider an upgrade.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net