就3行的indy用法fastMM4却一直报溢出,帮忙看下我的错还是indy的错(50分)

  • 主题发起人 主题发起人 tianzhen
  • 开始时间 开始时间
T

tianzhen

Unregistered / Unconfirmed
GUEST, unregistred user!
奇怪的是我从来没用到TIdProxyConnectionInfo过

FASTMM4报告片断:
--------------------------------2006/7/17 9:28:52--------------------------------
A memory block has been leaked. The size is: 28
Stack trace of when this block was allocated (return addresses):
402B23 [system.pas][System][@GetMem][2463]
40389F [system.pas][System][TObject.NewInstance][8473]
403C66 [system.pas][System][@ClassCreate][9138]
4B4AB2 [IdHTTPHeaderInfo][TIdProxyConnectionInfo.Create]
4C1BFE [IdHTTP][TIdCustomHTTP.Create]
522738 [unit_func.pas][unit_func][getcode][30]
521B75 [unit_chkvicurl.pas][unit_chkvicurl][Tchkvicurl.Execute2][251]
5217D9 [unit_chkvicurl.pas][unit_chkvicurl][Tchkvicurl.Execute][195]
42D3B9 [classes.pas][Classes][ThreadProc][9763]
The block is currently used for an object of class: TIdProxyConnectionInfo
The allocation number is: 552902
------------------------------
相关问题代码片断:
case mode of
0: Execute2;
//问题代码 [Tchkvicurl.Execute][195]
1: Execute1;
else
Execute2;
end;
...
if getcode(ss1, ss2) then
begin
//问题代码 [Tchkvicurl.Execute2][251]
...

function getcode(URL: string;
keyword: string): boolean;
var
myHTTP: TIDHttp;
ss:string;
begin
Result:= False;
myHTTP := TIDHttp.Create(nil);
//问题代码 [getcode][30]
try
try
myHTTP.HandleRedirects := true;
ss:= myHTTP.Get(URL);

if Keyword='' then
begin
if myHTTP.ResponseCode=200 then
Result :=true;
end else
begin
if (myHTTP.ResponseCode=200) and (ansipos(Keyword,ss)>0) then
//uses SysUtils
Result :=true;
end;
except
end;
finally
myHTTP.Free;
end;
end;
 
再看这2处溢出,跟我的程序好像一点没关系:
--------------------------------2006/7/17 9:28:52--------------------------------
A memory block has been leaked. The size is: 28
Stack trace of when this block was allocated (return addresses):
402B23 [system.pas][System][@GetMem][2463]
404851 [system.pas][System][@NewAnsiString][11990]
4047E4 [system.pas][System][@LStrAsg][11893]
4B5004 [IdHTTPHeaderInfo][TIdRequestHeaderInfo.Clear]
4B437E [IdHTTPHeaderInfo][TIdEntityHeaderInfo.Create]
4C3C1A [IdHTTP][TIdHTTPRequest.Create]
4C3C7A [IdHTTP][TIdHTTPProtocol.Create]
4C1BEC [IdHTTP][TIdCustomHTTP.Create]
522738 [unit_func.pas][unit_func][getcode][30]
The block is currently used for an object of class: Unknown
The allocation number is: 552981
--------------------------------2006/7/17 9:28:52--------------------------------
A memory block has been leaked. The size is: 28
Stack trace of when this block was allocated (return addresses):
402B23 [system.pas][System][@GetMem][2463]
40389F [system.pas][System][TObject.NewInstance][8473]
403C66 [system.pas][System][@ClassCreate][9138]
4B8532 [IdRFCReply][TIdRFCReply.Create]
4B5E71 [IdComponent][TIdComponent.Create]
4BA4A9 [IdTCPConnection][TIdTCPConnection.Create]
4BEDAF [IdTCPClient][TIdTCPClient.Create]
4C1B90 [IdHTTP][TIdCustomHTTP.Create]
522738 [unit_func.pas][unit_func][getcode][30]
The block is currently used for an object of class: TIdRFCReply
The allocation number is: 536447
 
栈溢出一般是循环条件出了问题,(比如有符号和无符号直接比较等),或者是巨大的本地数组!
排除的方法
1.根据经验观察代码
2.调试(F8),确定问题所在
3.屏蔽代码,确定问题所在.
不要过多的怀疑基础架构的问题.特别像一些比较专项,功能确定,代码量不大有很重要的架构,出问题的几率是很小的
 
您说各种方式都试了也没找到问题,有没有可能是某些网址导致的问题,比如某网址自动重定向之类的?
 
接受答案了.
 
后退
顶部