Subject: Hung sessions on Solaris 2.x

From: [email-masked]
Date: Thu, 13 Jul 1995 10:21:38 -0700

Greetings,

I'm having trouble with stock wu-ftpd-2.4 on a Solaris 2.4
system.  Basically I am seeing incoming ftp processes hang around
long past the supposed idle timeout period.

A 'ps -auwwx' reveals ftp daemons like the following:

USER       PID %CPU %MEM   SZ  RSS TT       S    START  TIME COMMAND
root      1716  0.0  0.3 1424  144 ?        S   Jul 11  0:01 in.ftpd -aiol -t 1800
root      2234  0.0  0.0 2100    4 ?        S   Jul 10  0:00 in.ftpd -aiol -t 1800
root      2501  0.0  0.8 1424  344 ?        S   Jul 12  0:00 in.ftpd -aiol -t 1800
root      2698  0.0  1.1 1424  496 ?        S   Jul 12  0:00 in.ftpd -aiol -t 1800

This list was made on the 13th, atleast 24 hours after these
connections were first established. 

If I connect to one of these processes with truss, it just seems
to be stuck in a read(2):

# truss -p 1716
read(0, 0x00055934, 8192)       (sleeping...)

There doesn't seem to be much commonality among these processes. 
Some are from WWW browsers, others are done by hand.
They all reflect the same pattern in the command log, though.
They all just log in and then hang - no further commands are seen.
Over a period a days or two I can vbuild up hundreds of these that
must be nuked by hand.

For example,

Jul 11 22:53:55 java ftpd[1716]: connection from autsun24.ethz.ch [129.132.50.24]
Jul 11 22:53:56 java ftpd[1716]: ANONYMOUS FTP LOGIN FROM autsun24.ethz.ch [129.132.50.24], mlt@

Jul 12 07:55:00 java ftpd[2501]: connection from 143.166.169.94 [143.166.169.94]
Jul 12 07:55:01 java ftpd[2501]: ANONYMOUS FTP LOGIN FROM 143.166.169.94 [143.166.169.94], [email-masked]

Jul 12 07:56:45 java ftpd[2698]: connection from curium.sietec.com [192.75.236.96]
Jul 12 07:56:47 java ftpd[2698]: ANONYMOUS FTP LOGIN FROM curium.sietec.com [192.75.236.96], [email-masked]

Has anyone else seen this behavior?

BTW, I think I have applied all the latest network and kernel patches
to this otherwise generic version of Solaris 2.4.  I had the same
problem before I applied the patches as well.

-csw

---

From: Keith Pilotti <[email-masked]>
Date: Thu, 13 Jul 1995 19:00:40 -0700

Here is a patch for a bug affecting idle timeouts when using the -t or -T 
commands.  Use of either of those options in the default ftpd will cause the 
corresponding timeout value to revert to zero meaning that *no timeout will be 
enforced*!

This bug applies to all platforms, however the fix has been tested only on 
SunOS4.1.x and Solaris 2.x.

+Keith

philly{178}>  [src] diff -c ,ftpd.c ftpd.c
*** ,ftpd.c     Wed Apr 13 14:17:18 1994
--- ftpd.c      Mon May 29 16:09:48 1995
***************
*** 347,359 ****
                  break;
  
              case 't':
!                 timeout = atoi(++cp);
                  if (maxtimeout < timeout)
                      maxtimeout = timeout;
                  goto nextopt;
  
              case 'T':
!                 maxtimeout = atoi(++cp);
                  if (timeout > maxtimeout)
                      timeout = maxtimeout;
                  goto nextopt;
--- 347,361 ----
                  break;
  
              case 't':
!                 argc--, argv++;
!                 timeout = atoi(*argv);
                  if (maxtimeout < timeout)
                      maxtimeout = timeout;
                  goto nextopt;
  
              case 'T':
!                 argc--, argv++;
!                 maxtimeout = atoi(*argv);
                  if (timeout > maxtimeout)
                      timeout = maxtimeout;
                  goto nextopt;

  > Jul 12 07:55:01 java ftpd[2501]: ANONYMOUS FTP LOGIN FROM 143.166.169.94 [1
43.166.169.94], [email-masked]

--
Keith F. Pilotti                                [email-masked]
QUALCOMM Incorporated                           UNIX Computer Support Team
6455 Lusk Boulevard                             +1 619 658-4555 (Voice)
San Diego, CA 92121-2779                        +1 619 658-2115 (FAX)