Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EAccessViolation: Access violation at address 000000000043F20A in module 'CrossH ttpConsole.exe' #95

Open
isgbuddy opened this issue Mar 8, 2021 · 12 comments

Comments

@isgbuddy
Copy link

isgbuddy commented Mar 8, 2021

C:\temp>CrossHttpConsole.exe
Windows 7 Service Pack 1 (Version 6.1, Build 7601, 64-bit Edition)
EAccessViolation: Access violation at address 000000000043F20A in module 'CrossH
ttpConsole.exe'. Read of address 0000000000000040
Unexpected Memory Leak
An unexpected memory leak has occurred. The unexpected small block leaks are:

9 - 24 bytes: TDictionary<System.UInt64,Net.CrossSocket.Base.ICrossListen>.TValu
eCollection x 1, TDictionary<System.UInt64,Net.CrossSocket.Base.ICrossConnection

.TValueCollection x 1, TObject x 2
57 - 72 bytes: Unknown x 2
89 - 104 bytes: TDictionary<System.UInt64,Net.CrossSocket.Base.ICrossConnection>
x 1, TDictionary<System.UInt64,Net.CrossSocket.Base.ICrossListen> x 1
569 - 616 bytes: TCrossHttpServer x 1

C:\temp>

@isgbuddy
Copy link
Author

isgbuddy commented Mar 8, 2021

Windows7 + Delphi 10.2.3

@isgbuddy
Copy link
Author

isgbuddy commented Mar 8, 2021

我这么衰?跑你们官方自带的 demo 出错

@pony5551
Copy link

pony5551 commented Mar 8, 2021

自行调试一下,我10.4.1没有问题

看你这提示TCrossHttpServer都没释放掉

@pony5551
Copy link

pony5551 commented Mar 9, 2021

我说明一下出错原因!
uDM.pas 的201行 FHttpServer := TCrossHttpServer.Create(0, True);
改成
FHttpServer := TCrossHttpServer.Create(0, False);

demo默认启用https,但没有证书文件,你也可以自己生成证书文件测试

@isgbuddy
Copy link
Author

isgbuddy commented Mar 9, 2021

谢谢,我试试

@isgbuddy
Copy link
Author

isgbuddy commented Mar 9, 2021

procedure TDM.DataModuleCreate(Sender: TObject);
begin
{$IFDEF CROSS_SSL}
FHttpServer := TCrossHttpServer.Create(0, True);
if FHttpServer.SSL then
begin
FHttpServer.SetCertificate(SSL_SERVER_CERT);
FHttpServer.SetPrivateKey(SSL_SERVER_PKEY);
end;
{$ELSE}
FHttpServer := TCrossHttpServer.Create(0, false);
{$ENDIF}
// FHttpServer.Addr := IPv4_ALL; // IPv4
// FHttpServer.Addr := IPv6_ALL; // IPv6
FHttpServer.Addr := IPv4v6_ALL; // IPv4v6
FHttpServer.Port := AppCfg.ListenPort;
FHttpServer.Compressible := True;

FHttpServer.OnConnected := _OnConnected;
FHttpServer.OnDisconnected := _OnDisconnected;

_CreateRouter;
_CreateWatchThread;
end;

@isgbuddy
Copy link
Author

isgbuddy commented Mar 9, 2021

建议把这个 demo 这里改成这样,就不出一上来就出错了,会给人感觉不太好

@pony5551
Copy link

pony5551 commented Mar 9, 2021

这个本来没有bug的,后来rony建议搞成https,http共存,所以就出了这个bug!
话说作者好久没出现了,估计比较忙

@pony5551
Copy link

pony5551 commented Mar 9, 2021

小问题自己折腾一下,框架还是很稳定的,运行90天无报错,因系统更新才重启的

@isgbuddy
Copy link
Author

isgbuddy commented Mar 9, 2021

@pony5551 这个框架推荐跑在 linux 下还 windows 下比较好?我看更新日志里写 linux 可能会有内存泄漏?

@pony5551
Copy link

pony5551 commented Mar 9, 2021

linux下只要不用ssl就没问题,这个是openssl的问题!你可以找个稳定一点的openssl自己折腾一下

@isgbuddy
Copy link
Author

isgbuddy commented Mar 9, 2021

linux下只要不用ssl就没问题,这个是openssl的问题!你可以找个稳定一点的openssl自己折腾一下

感谢感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants