04-09-2021, 06:47 PM
Hello,
My Indy TcpSSLServer crashes several times. I made a test solution with 1 Server and 5 Clients. Every client has 10 Threads. Each Thread connects, transmits, receives and closes the socket every 2 seconds. After 100000 – 200000 connects, the Server crashes with a memory access error. I found the access error in “IdSSLOpenSSL.pas” in “function TidSSLIOHandlerSocketOpenSSL.Readable”. The SocketClass
“fSSLSocket” was nil. Why? I don’t know.
I changed the source and it works.
function TIdSSLIOHandlerSocketOpenSSL.Readable(AMSec: Integer = IdTimeoutDefault): Boolean;
begin
if not fPassThrough then
begin
// Result := (ssl_pending(fSSLSocket.fSSL) > 0); //Original implementation
Result := Assigned(fSSLSocket) and (ssl_pending(fSSLSocket.fSSL) > 0);
if Result then Exit;
end;
Result := inherited Readable(AMSec);
end;
maybe that will help the users too
My system:
Linux: x86_64
Lazarus: 2.0.10
FPC: 3.2.0
Indy: 10.6.2
My Indy TcpSSLServer crashes several times. I made a test solution with 1 Server and 5 Clients. Every client has 10 Threads. Each Thread connects, transmits, receives and closes the socket every 2 seconds. After 100000 – 200000 connects, the Server crashes with a memory access error. I found the access error in “IdSSLOpenSSL.pas” in “function TidSSLIOHandlerSocketOpenSSL.Readable”. The SocketClass
“fSSLSocket” was nil. Why? I don’t know.
I changed the source and it works.
function TIdSSLIOHandlerSocketOpenSSL.Readable(AMSec: Integer = IdTimeoutDefault): Boolean;
begin
if not fPassThrough then
begin
// Result := (ssl_pending(fSSLSocket.fSSL) > 0); //Original implementation
Result := Assigned(fSSLSocket) and (ssl_pending(fSSLSocket.fSSL) > 0);
if Result then Exit;
end;
Result := inherited Readable(AMSec);
end;
maybe that will help the users too

My system:
Linux: x86_64
Lazarus: 2.0.10
FPC: 3.2.0
Indy: 10.6.2