プログラム (server.exe) を Visual C++ 2010 Express のデバッガーで実行すると完全に実行されますが、exe として実行すると実行されません。「Server.exe が動作を停止しました」ダイアログでクラッシュします。
次に、exe の名前を「ServerInstaller.exe」に変更したところ、機能したので、アクセス許可エラーであると考えましたが、管理者モードの「Server.exe」では機能しません。
次に、VC++ のデバッガーを "Server.exe" プログラムにアタッチすると、"free.c" で例外が発生しました。
このファイルのコードは
void __cdecl _free_base (void * pBlock)
{
int retval = 0;
if (pBlock == NULL)
return;
RTCCALLBACK(_RTC_Free_hook, (pBlock, 0));
retval = HeapFree(_crtheap, 0, pBlock); // Exception thrown in this function
if (retval == 0)
{
errno = _get_errno_from_oserr(GetLastError());
}
}
例外は
Server.exe の 0x770ae3be で未処理の例外: 0xC0000005: アクセス違反の読み取り場所 0x3765f8c7。
pBlock の値を調べたところ、0x007f82c0 です。
私のプログラム。
私のプログラムは RakNet サーバーで、プレーヤーが正常に削除されました。サーバーはその時点で RakNet からのメッセージをチェックしています。
スタック トレース バック
ntdll.dll!770ae3be()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!770ae023()
kernel32.dll!75e814dd()
> msvcr100d.dll!_free_base(void * pBlock) Line 50 + 0x13 bytes C
msvcr100d.dll!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1431 + 0x9 bytes C++
msvcr100d.dll!_free_dbg(void * pUserData, int nBlockUse) Line 1265 + 0xd bytes C++
msvcr100d.dll!free(void * pUserData) Line 49 + 0xb bytes C++
RakNetDebug.dll!RakNet::_RakFree_Ex(void * p, const char * file, unsigned int line) Line 165 + 0xc bytes C++
RakNetDebug.dll!RakNet::ReliabilityLayer::FreeInternalPacketData(RakNet::InternalPacket * internalPacket, const char * file, unsigned int line) Line 3766 + 0x17 bytes C++
RakNetDebug.dll!RakNet::ReliabilityLayer::RemovePacketFromResendListAndDeleteOlderReliableSequenced(RakNet::uint24_t messageNumber, unsigned __int64 time, DataStructures::List<RakNet::PluginInterface2 *> & messageHandlerList, const RakNet::SystemAddress & systemAddress) Line 2391 C++
RakNetDebug.dll!RakNet::ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer(const char * buffer, unsigned int length, RakNet::SystemAddress & systemAddress, DataStructures::List<RakNet::PluginInterface2 *> & messageHandlerList, int MTUSize, unsigned int s, RakNet::RakNetRandom * rnr, unsigned short remotePortRakNetWasStartedOn_PS3, unsigned int extraSocketOptions, unsigned __int64 timeRead, RakNet::BitStream & updateBitStream) Line 776 C++
RakNetDebug.dll!RakNet::ProcessNetworkPacket(RakNet::SystemAddress systemAddress, const char * data, const int length, RakNet::RakPeer * rakPeer, RakNet::RakNetSmartPtr<RakNet::RakNetSocket> rakNetSocket, unsigned __int64 timeRead, RakNet::BitStream & updateBitStream) Line 5012 C++
RakNetDebug.dll!RakNet::RakPeer::RunUpdateCycle(unsigned __int64 timeNS, unsigned __int64 timeMS, RakNet::BitStream & updateBitStream) Line 5099 + 0x81 bytes C++
RakNetDebug.dll!RakNet::UpdateNetworkLoop(void * arguments) Line 5868 C++
msvcr100d.dll!_callthreadstartex() Line 314 + 0xf bytes C
msvcr100d.dll!_threadstartex(void * ptd) Line 297 C
kernel32.dll!75e833aa()
ntdll.dll!770b9ef2()
ntdll.dll!770b9ec5()