C ++ exception "The thread tried to read or write to a virtual address for which it does not have appropriate access."

In an attempt to track down some difficulties with crash reproduction, I set up UnhandledExceptionFilterto create mini-dump files as described here: Debug custom filters For unhandled exceptions and Effective mini-copies

Dumps have been successfully captured, but I don’t really like to interpret stack information. In the hope that someone else will experience something similar, I will provide as many details as possible. Sorry if as a result this question is a bit detailed.

Visual Studio provides the following dump summary:

Dump Summary
------------
Dump File:  MiniDump.dmp
Last Write Time:    15/08/2012 22:07:22
Process Name:   Server.exe : C:\Project\Server.exe
Process Architecture:   x86
Exception Code: 0xC0000005
Exception Information:  The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
Heap Information:   Not Present

System Information
------------------
OS Version: 6.1.7601
CLR Version(s): 

Modules
-------
Module Name Module Path Module Version
----------- ----------- --------------
Server.exe  C:\Project\Server.exe   1.0.0.1
ntdll.dll   C:\Windows\SysWOW64\ntdll.dll   6.1.7601.17725
kernel32.dll    C:\Windows\SysWOW64\kernel32.dll    6.1.7601.17651
KERNELBASE.dll  C:\Windows\SysWOW64\KERNELBASE.dll  6.1.7601.17651
mysqlpp_d.dll   C:\Projects\Ken11\bin\debug\mysqlpp_d.dll   0.0.0.0
wsock32.dll C:\Windows\System32\wsock32.dll 6.1.7600.16385
ws2_32.dll  C:\Windows\SysWOW64\ws2_32.dll  6.1.7601.17514
msvcrt.dll  C:\Windows\SysWOW64\msvcrt.dll  7.0.7601.17744
libmySQL.dll    C:\Projects\Ken11\bin\debug\libmySQL.dll    0.0.0.0
user32.dll  C:\Windows\SysWOW64\user32.dll  6.1.7601.17514
advapi32.dll    C:\Windows\SysWOW64\advapi32.dll    6.1.7601.17514
msvcp90d.dll    C:\Projects\Ken11\bin\debug\Microsoft.VC90.DebugCRT\msvcp90d.dll    9.0.21022.8
msvcr90d.dll    C:\Projects\Ken11\bin\debug\Microsoft.VC90.DebugCRT\msvcr90d.dll    9.0.21022.8
mfc90d.dll  C:\Projects\Ken11\bin\debug\Microsoft.VC90.DebugMFC\mfc90d.dll  9.0.21022.8
dbghelp.dll C:\Windows\System32\dbghelp.dll 6.1.7601.17514
mswsock.dll C:\Windows\System32\mswsock.dll 6.1.7601.17514
wininet.dll C:\Windows\SysWOW64\wininet.dll 8.0.7601.17785
rasman.dll  C:\Windows\System32\rasman.dll  6.1.7600.16385
devobj.dll  C:\Windows\SysWOW64\devobj.dll  6.1.7601.17621

, , :

    msvcr90d.dll!6d69f824()     
    [Frames below may be incorrect and/or missing, no symbols loaded for msvcr90d.dll]  
--> Server.exe!CServer::LoadPageList()  Line 269 + 0x28 bytes   C++
    cccccccc()  

, __RtlUserThreadStart :

mswsock.dll!_WSPRecv@36()  + 0x34ff bytes   
ws2_32.dll!_WSARecv@28()  + 0x71 bytes  
wsock32.dll!_recv@16()  + 0x33 bytes    
>libmySQL.dll!008aaa2f()    
[Frames below may be incorrect and/or missing, no symbols loaded for libmySQL.dll]  
libmySQL.dll!008aac0d()     
libmySQL.dll!008a34d7()     
libmySQL.dll!008a30d2()     
libmySQL.dll!0084be35()     
libmySQL.dll!00851572()     
libmySQL.dll!00851c2b()     
Server.exe!CServer::logStatusToDB(AsynchStatus_T * pStatus=0x04f18170)  Line 1717   C++
Server.exe!CServer::checkStatus(AsynchStatus_T * pStatus=0x04f18170)  Line 2145 C++
Server.exe!CThread::ControllingFunction(void * lpParameter=0x03fffe08)  Line 1280 + 0xf bytes   C++
kernel32.dll!@BaseThreadInitThunk@12()  + 0x12 bytes    
ntdll.dll!___RtlUserThreadStart@8()  + 0x27 bytes   
ntdll.dll!__RtlUserThreadStart@8()  + 0x1b bytes    

0xCCCCCCCC?

Server.exe!CServer::LoadPageList() Line 269 + 0x28 bytes

00453217  mov         byte ptr [ebp-4],0  
0045321B  mov         esi,esp  
0045321D  lea         ecx,[ebp-104h]  
00453223  call        dword ptr [__imp_ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >::~CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > (6DA994h)]  
00453229  cmp         esi,esp  
0045322B  call        _RTC_CheckEsp (690D20h)  
00453230  mov         dword ptr [ebp-4],0FFFFFFFFh  
00453237  mov         esi,esp  
00453239  lea         ecx,[ebp-20h]  
0045323C  call        dword ptr [__imp_ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >::~CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > (6DA994h)]  
00453242  cmp         esi,esp  
00453244  call        _RTC_CheckEsp (690D20h)  
00453249  push        edx  
0045324A  mov         ecx,ebp  
0045324C  push        eax  
0045324D  lea         edx,[ (45327Ch)]  
00453253  call        _RTC_CheckStackVars (690D50h)  
00453258  pop         eax             <<<=== exception refers to this line
00453259  pop         edx  
0045325A  mov         ecx,dword ptr [ebp-0Ch]  
0045325D  mov         dword ptr fs:[0],ecx  
00453264  pop         ecx  
00453265  pop         edi  

Update

( Joachim):

void CServer::LoadPageList()
{
    CString header;
    header.Format("Accept: text/plain, */*; q=0.01\r\n");
    _pSession->setHttpHeader (header);
    _pSession->ReadPage (_T("/Pages"), true);
    SaveTimeStampedFile ("Pages.txt");
}

, LoadPageList , , , , .

+5

All Articles