有个MFC 程序运行几个小时候报错,具体时间随机,错误提示为:0x73FB4245 (usp10.dll) (StD46C.dmp 中)处有未经处理的异常: 0xC0000005: 写入位置 0x00000254 时发生访问冲突。中断后最内层为以下函数:
inline void* CThreadSlotData::GetThreadValue(int nSlot)
{
EnterCriticalSection(&m_sect);
ASSERT(nSlot != 0 && nSlot < m_nMax);
ASSERT(m_pSlotData != NULL);
ASSERT(m_pSlotData[nSlot].dwFlags & SLOT_USED);
ASSERT(m_tlsIndex != (DWORD)-1);
if( nSlot <= 0 || nSlot >= m_nMax ) // check for retail builds.
{
LeaveCriticalSection(&m_sect);
return NULL;
}
CThreadData* pData = (CThreadData*)TlsGetValue(m_tlsIndex);
if (pData == NULL || nSlot >= pData->nCount)
{
LeaveCriticalSection(&m_sect);
return NULL;
}
void* pRetVal = pData->pData[nSlot];
LeaveCriticalSection(&m_sect);
return pRetVal;
}
报错停在这里 return pRetVal;
堆栈信息如下:
在工作线程数据处理完后,使用PostMessage更新界面,我的PostMessage刷新频率很快,60ms,是因为刷新过快引起的GetDlgItem返回NULL吗?哪位网友遇见过。
PostMessage是线程给主线程发消息吗?消息带参数没有?参数的生命期如何?
目前,将GetDlgItem返回NULL时,的确会产生上述类似的堆栈错误,但不是完全一致。
网上类似的问题,
错误提示为:0x73FB4245 (usp10.dll) 还有为什么会出现usp10.dll,我看网上都说是病毒,我程序都没有加载该模块dll。
程序运行过程中,内存基本无变化。
有谁遇到过该问题,帮忙分析分析,谢谢!