Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indy TcpSSLServer crashes several times
#2
(04-09-2021, 06:47 PM)fpctuxe Wrote: 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.

Likely related to this issue:

https://github.com/IndySockets/Indy/issues/218

When TIdSSLIOHandlerSocketOpenSSL is closed, it destroys its fSSLSocket object, rather than just closing the underlying socket connection but leaving fSSLSocket alive.

(04-09-2021, 06:47 PM)fpctuxe Wrote: I changed the source and it works.

I don't fully agree with that "fix", as it is just a workaround, which introduces a new race condition, and does not really address the root issue. But without a better fix, I have accepted and checked it in for now, thanks.

Another workaround I have considered before, but haven't implemented yet, is to have TIdSSLIOHandlerSocketOpenSSL override the virtual SourceIsAvailable() method to return False when fSSLSocket is nil. TIdIOHandler.ReadFromSource() checks SourceIsAvailable() before and after calling Readable(). But this is also causes a subtle race condition, too.

Reply


Messages In This Thread
RE: Indy TcpSSLServer crashes several times - by rlebeau - 04-10-2021, 12:41 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)