TIdFTP based application is randomly freezing Indy 10.0.52

Giganews Newsgroups
Subject: TIdFTP based application is randomly freezing Indy 10.0.52
Posted by:  iomongol (iomong…@yahoo.com)
Date: Wed, 8 Mar 2006

Greetings,
We have FTP client written that most of the time works just fine. Once in a while (can be every day, can be every hour) program is freezing completely without any chance to come back to life.
Below is result from packet sniffer at the time when client did freeze.
First packet of interest (IMHO) is:
    294 4722.880433 168.0.0.1          168.0.0.2        FTP      Response: 425 Can't open data connection.

I wonder if Indy doesn't expect such behaviour of FTP server and waits for something forever. Please help, our roof is burning.

Specifics:
Delphi 7 + sp
Indy 10.0.52
FTP (NotPassive, Port 21, nothing special)
Thanks in advance,
ilya

No.    Time        Source                Destination          Protocol Info
    271 3869.797625 168.0.0.2        168.0.0.1          TCP      2252 > ftp [RST, ACK] Seq=195 Ack=418 Win=0 Len=0

Frame 271 (54 bytes on wire, 54 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 2252 (2252), Dst Port: ftp (21), Seq: 195, Ack: 418, Len: 0

No.    Time        Source                Destination          Protocol Info
    272 4558.768269 168.0.0.2        168.0.0.1          TCP      1619 > ftp [SYN] Seq=0 Ack=0 Win=65535 Len=0 MSS=1460

Frame 272 (62 bytes on wire, 62 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 0, Ack: 0, Len: 0

No.    Time        Source                Destination          Protocol Info
    274 4558.819439 168.0.0.2        168.0.0.1          TCP      1619 > ftp [ACK] Seq=1 Ack=1 Win=65535 [TCP CHECKSUM INCORRECT] Len=0

Frame 274 (54 bytes on wire, 54 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 1, Ack: 1, Len: 0

No.    Time        Source                Destination          Protocol Info
    275 4558.870388 168.0.0.1          168.0.0.2        FTP      Response: 220 Microsoft FTP Service

Frame 275 (81 bytes on wire, 81 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 1, Ack: 1, Len: 27
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    276 4558.870559 168.0.0.2        168.0.0.1          FTP      Request: USER zorro

Frame 276 (78 bytes on wire, 78 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 1, Ack: 28, Len: 24
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    277 4558.921588 168.0.0.1          168.0.0.2        FTP      Response: 331 Password required for zorro.

Frame 277 (100 bytes on wire, 100 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 28, Ack: 25, Len: 46
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    278 4558.921742 168.0.0.2        168.0.0.1          FTP      Request: PASS superb

Frame 278 (76 bytes on wire, 76 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 25, Ack: 74, Len: 22
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    279 4558.973307 168.0.0.1          168.0.0.2        FTP      Response: 230 User zorro logged in.

Frame 279 (93 bytes on wire, 93 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 74, Ack: 47, Len: 39
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    280 4558.973474 168.0.0.2        168.0.0.1          FTP      Request: FEAT

Frame 280 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 47, Ack: 113, Len: 6
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    281 4559.024250 168.0.0.1          168.0.0.2        FTP      Response: 211-FEAT

Frame 281 (64 bytes on wire, 64 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 113, Ack: 53, Len: 10
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    282 4559.177767 168.0.0.2        168.0.0.1          TCP      1619 > ftp [ACK] Seq=53 Ack=123 Win=65413 [TCP CHECKSUM INCORRECT] Len=0

Frame 282 (54 bytes on wire, 54 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 53, Ack: 123, Len: 0

No.    Time        Source                Destination          Protocol Info
    283 4559.228692 168.0.0.1          168.0.0.2        FTP      Response:    SIZE

Frame 283 (83 bytes on wire, 83 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 123, Ack: 53, Len: 29
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    284 4559.228914 168.0.0.2        168.0.0.1          FTP      Request: TYPE I

Frame 284 (62 bytes on wire, 62 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 53, Ack: 152, Len: 8
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    285 4559.279718 168.0.0.1          168.0.0.2        FTP      Response: 200 Type set to I.

Frame 285 (74 bytes on wire, 74 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 152, Ack: 61, Len: 20
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    287 4559.330846 168.0.0.1          168.0.0.2        FTP      Response: 215 Windows_NT

Frame 287 (70 bytes on wire, 70 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 172, Ack: 67, Len: 16
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    288 4559.334005 168.0.0.2        168.0.0.1          FTP      Request: PORT 172,16,251,14,6,94

Frame 288 (79 bytes on wire, 79 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 67, Ack: 188, Len: 25
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    289 4559.385081 168.0.0.1          168.0.0.2        FTP      Response: 200 PORT command successful.

Frame 289 (84 bytes on wire, 84 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 188, Ack: 92, Len: 30
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    290 4559.385253 168.0.0.2        168.0.0.1          FTP      Request: STOR file.zip

Frame 290 (85 bytes on wire, 85 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 92, Ack: 218, Len: 31
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    291 4559.587707 168.0.0.1          168.0.0.2        TCP      ftp > 1619 [ACK] Seq=218 Ack=123 Win=65413 Len=0

Frame 291 (60 bytes on wire, 60 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 218, Ack: 123, Len: 0

No.    Time        Source                Destination          Protocol Info
    292 4701.887446 168.0.0.1          168.0.0.2        FTP      Response: 150 Opening BINARY mode data connection for file.zip.

Frame 292 (125 bytes on wire, 125 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 218, Ack: 123, Len: 71
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    293 4702.016047 168.0.0.2        168.0.0.1          TCP      1619 > ftp [ACK] Seq=123 Ack=289 Win=65247 [TCP CHECKSUM INCORRECT] Len=0

Frame 293 (54 bytes on wire, 54 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 123, Ack: 289, Len: 0

No.    Time        Source                Destination          Protocol Info
    294 4722.880433 168.0.0.1          168.0.0.2        FTP      Response: 425 Can't open data connection.

Frame 294 (87 bytes on wire, 87 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 289, Ack: 123, Len: 33
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    296 4885.813925 168.0.0.1          168.0.0.2        FTP      Response: 421 Timeout (120 seconds): closing control connection.

Frame 296 (110 bytes on wire, 110 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 322, Ack: 123, Len: 56
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    297 4885.977937 168.0.0.2        168.0.0.1          TCP      1619 > ftp [ACK] Seq=123 Ack=378 Win=65158 [TCP CHECKSUM INCORRECT] Len=0

Frame 297 (54 bytes on wire, 54 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 123, Ack: 378, Len: 0

No.    Time        Source                Destination          Protocol Info
    298 4887.047640 168.0.0.1          168.0.0.2        FTP      Response: 421 Terminating connection.

Frame 298 (83 bytes on wire, 83 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 1619 (1619), Seq: 378, Ack: 123, Len: 29
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    299 4887.047671 168.0.0.2        168.0.0.1          TCP      1619 > ftp [ACK] Seq=123 Ack=408 Win=65129 [TCP CHECKSUM INCORRECT] Len=0

Frame 299 (54 bytes on wire, 54 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 1619 (1619), Dst Port: ftp (21), Seq: 123, Ack: 408, Len: 0

No.    Time        Source                Destination          Protocol Info
    300 4957.534035 168.0.0.2        168.0.0.1          TCP      3368 > ftp [SYN] Seq=0 Ack=0 Win=65535 Len=0 MSS=1460

Frame 300 (62 bytes on wire, 62 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 3368 (3368), Dst Port: ftp (21), Seq: 0, Ack: 0, Len: 0

No.    Time        Source                Destination          Protocol Info
    301 4957.585002 168.0.0.1          168.0.0.2        TCP      ftp > 3368 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1380

Frame 301 (62 bytes on wire, 62 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 3368 (3368), Seq: 0, Ack: 1, Len: 0

No.    Time        Source                Destination          Protocol Info
    302 4957.585030 168.0.0.2        168.0.0.1          TCP      3368 > ftp [ACK] Seq=1 Ack=1 Win=65535 [TCP CHECKSUM INCORRECT] Len=0

Frame 302 (54 bytes on wire, 54 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 3368 (3368), Dst Port: ftp (21), Seq: 1, Ack: 1, Len: 0

No.    Time        Source                Destination          Protocol Info
    303 4957.635910 168.0.0.1          168.0.0.2        FTP      Response: 220 Microsoft FTP Service

Frame 303 (81 bytes on wire, 81 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 3368 (3368), Seq: 1, Ack: 1, Len: 27
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    304 4957.636089 168.0.0.2        168.0.0.1          FTP      Request: USER zorro

Frame 304 (78 bytes on wire, 78 bytes captured)
Ethernet II, Src: Dell_15:45:1a (00:14:22:15:45:1a), Dst: Cisco_39:e3:40 (00:12:da:39:e3:40)
Internet Protocol, Src: 168.0.0.2 (168.0.0.2), Dst: 168.0.0.1 (168.0.0.1)
Transmission Control Protocol, Src Port: 3368 (3368), Dst Port: ftp (21), Seq: 1, Ack: 28, Len: 24
File Transfer Protocol (FTP)

No.    Time        Source                Destination          Protocol Info
    305 4957.686972 168.0.0.1          168.0.0.2        FTP      Response: 331 Password required for zorro.

Frame 305 (100 bytes on wire, 100 bytes captured)
Ethernet II, Src: Cisco_39:e3:40 (00:12:da:39:e3:40), Dst: Dell_15:45:1a (00:14:22:15:45:1a)
Internet Protocol, Src: 168.0.0.1 (168.0.0.1), Dst: 168.0.0.2 (168.0.0.2)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 3368 (3368), Seq: 28, Ack: 25, Len: 46
File Transfer Protocol (FTP)

Replies