0

我在 C++ Builder 2010 项目中低于 EAccessViolation 异常。
StackTrace 没有在其中显示我的任何项目文件。如何找到错误的位置?此应用程序使用 TIdTCPServer 组件。

调用堆栈信息:
-------------------------------------------------- -------------------------------------------------- -
|地址 |模块 |单元 |类 |过程/方法 |行 |
-------------------------------------------------- -------------------------------------------------- -
|*异常线程:ID=44100;优先级=0;类=TIdThreadWithTask |
|------------------------------------------------- -------------------------------------------------- |
|004E17AC|Desktop.exe |System.pas |TObject |免费 |9458[2] |
|004E226E|Desktop.exe |System.pas | |_HandleFinallyInternal |11939[16]|
|7D4D936A|kernel32.dll| | |MultiByteToWideChar | |
|7D4DCD06|kernel32.dll| | |虚拟查询Ex | |
|7D4D920B|kernel32.dll| | |MultiByteToWideChar | |
|004E7034|Desktop.exe |System.pas | |Utf8ToUnicode |22264[5] |
|004E0601|Desktop.exe |System.pas | |_ReallocMem |3097[9] |
|004E05F4|Desktop.exe |System.pas | |_ReallocMem |3089[1] |
|004E4129|Desktop.exe |System.pas | |_USrSetLength |17365[37]|
|004E3D5C|Desktop.exe |System.pas | |_UStrAsg |16893[1] |
|004E737F|Desktop.exe |System.pas | |UTF8ToUnicodeString |22433[11]|
|004E3D4C|Desktop.exe |System.pas | |_USTrClr |16849[1] |
|004E7394|Desktop.exe |System.pas | |UTF8ToUnicodeString |22434[12]|
|004E1FBA|Desktop.exe |System.pas | |_HandleAnyException |11315[84]|
|7D4D936A|kernel32.dll| | |MultiByteToWideChar | |
|004E05E0|Desktop.exe |System.pas | |_FreeMem |3030[6] |
|004E05DC|Desktop.exe |System.pas | |_FreeMem |3025[1] |
|004E2AB4|Desktop.exe |System.pas | |_LStrClr |13683[12]|
|004E2A98|Desktop.exe |System.pas | |_LStrClr |13672[1] |
|004E3EBD|Desktop.exe |System.pas | |_UStrFromPWCharLen |17101[28]|
|7D620341|ntdll.dll | | |RtlNtStatusToDosErrorNoTeb | |
|7D62031F|ntdll.dll | | |RtlNtStatusToDosError | |
|7D620324|ntdll.dll | | |RtlNtStatusToDosError | |
|7D620341|ntdll.dll | | |RtlNtStatusToDosErrorNoTeb | |
|7D62031F|ntdll.dll | | |RtlNtStatusToDosError | |
|7D620324|ntdll.dll | | |RtlNtStatusToDosError | |
|7D4DCCEF|kernel32.dll| | |虚拟查询Ex | |
|7D4DCCE1|kernel32.dll| | |虚拟查询 | |
|004E1FBA|Desktop.exe |System.pas | |_HandleAnyException |11315[84]|
|7D61EA51|ntdll.dll | | |KiUserExceptionDispatcher | |
|004E21F6|Desktop.exe |System.pas | |_HandleFinally |11872[39]|
|7D61F1D7|ntdll.dll | | |RtlLeaveCriticalSection | |
|7D6251EB|ntdll.dll | | |LdrUnlockLoaderLock | |
|7D6251F2|ntdll.dll | | |LdrUnlockLoaderLock | |
|7D4D936A|kernel32.dll| | |MultiByteToWideChar | |
|7D4DCD06|kernel32.dll| | |虚拟查询Ex | |
|7D4D920B|kernel32.dll| | |MultiByteToWideChar | |
|004E7034|Desktop.exe |System.pas | |Utf8ToUnicode |22264[5] |
|004E0601|Desktop.exe |System.pas | |_ReallocMem |3097[9] |
|004E05F4|Desktop.exe |System.pas | |_ReallocMem |3089[1] |
|004E4129|Desktop.exe |System.pas | |_USrSetLength |17365[37]|
|004E3D5C|Desktop.exe |System.pas | |_UStrAsg |16893[1] |
|004E737F|Desktop.exe |System.pas | |UTF8ToUnicodeString |22433[11]|
|004E3D4C|Desktop.exe |System.pas | |_USTrClr |16849[1] |
|004E7394|Desktop.exe |System.pas | |UTF8ToUnicodeString |22434[12]|
|004E1FBA|Desktop.exe |System.pas | |_HandleAnyException |11315[84]|
|7D4D936A|kernel32.dll| | |MultiByteToWideChar | |
|004E05E0|Desktop.exe |System.pas | |_FreeMem |3030[6] |
|004E05DC|Desktop.exe |System.pas | |_FreeMem |3025[1] |
|004E2AB4|Desktop.exe |System.pas | |_LStrClr |13683[12]|
|004E2A98|Desktop.exe |System.pas | |_LStrClr |13672[1] |
|004E3EBD|Desktop.exe |System.pas | |_UStrFromPWCharLen |17101[28]|
|7D620341|ntdll.dll | | |RtlNtStatusToDosErrorNoTeb | |
|7D62031F|ntdll.dll | | |RtlNtStatusToDosError | |
|7D620324|ntdll.dll | | |RtlNtStatusToDosError | |
|7D620341|ntdll.dll | | |RtlNtStatusToDosErrorNoTeb | |
|7D62031F|ntdll.dll | | |RtlNtStatusToDosError | |
|7D620324|ntdll.dll | | |RtlNtStatusToDosError | |
|7D4DCCEF|kernel32.dll| | |虚拟查询Ex | |
|7D4DCCE1|kernel32.dll| | |虚拟查询 | |
|7D61F1D7|ntdll.dll | | |RtlLeaveCriticalSection | |
|004E1FBA|Desktop.exe |System.pas | |_HandleAnyException |11315[84]|
|7D61EA51|ntdll.dll | | |KiUserExceptionDispatcher | |
|004B120E|Desktop.exe |Classes.pas | |线程处理 |11018[8] |
|004E2A0C|Desktop.exe |System.pas | |线程包装 |13579[33]|
|------------------------------------------------- -------------------------------------------------- |
|调用线程:ID=68288;优先级=2;类=TIdListenerThread |
|------------------------------------------------- -------------------------------------------------- |
|004B1ED0|Desktop.exe |Classes.pas |TThread |简历 |11558[1] |
|004B1EC8|Desktop.exe |Classes.pas |TThread |Resume |11557[0] |
|004B120E|Desktop.exe |Classes.pas | |线程处理 |11018[8] |
|004E2A0C|Desktop.exe |System.pas | |线程包装 |13579[33]|
|------------------------------------------------- -------------------------------------------------- |
| |
4

2 回答 2

0

这应该是损坏的内存或指针。这不会很容易调试,您需要验证您使用的所有指针都具有正确的值,并且您不会在任何地方越界。

于 2010-04-09T13:08:48.673 回答
0

从以下网址下载最新版本的 FastMM:http: //sourceforge.net/projects/fastmm/files/FastMM%204.x%20Stable%20Releases/

在 c++builder 中安装它。
阅读文档如何在 FastMM 中设置调试模式。
如果你有悬空指针或写入禁忌位置,FastMM 应该很快就能找到它们。

祝你好运。

(请注意,包含了一个更简单的 FastMM 版本但这个版本更深入)

于 2011-05-30T13:24:00.627 回答