Hello,

I have a server programing running on solaris 8 ultra 5. It seems has
a bug happens very very occasionally. I use lsof and pfile commands
to check its status, Could anybody enlighten me on the printout. The
program never binds to the port 0. I don't know how we have the fd 5,
7, 9 here?

lsof seems more powerful, as pfiles often fails to report fd usage,
for example: $pfiles 6475 [RET]
pfiles: cannot control process 6475


feed0:133 fd$pfiles 21806
Current rlimit: 1024 file descriptors
4: S_IFSOCK mode:0666 dev:230,0 ino:48805 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 0.0.0.0 port: 11094
5: S_IFSOCK mode:0666 dev:230,0 ino:45923 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 0.0.0.0 port: 0
6: S_IFSOCK mode:0666 dev:230,0 ino:33530 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 0.0.0.0 port: 10094
7: S_IFSOCK mode:0666 dev:230,0 ino:11224 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 0.0.0.0 port: 0
8: S_IFSOCK mode:0666 dev:230,0 ino:48806 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 192.168.210.107 port: 10094
peername: AF_INET 192.168.205.206 port: 60312
9: S_IFSOCK mode:0666 dev:230,0 ino:54745 uid:0 gid:0 size:0
O_RDWR
sockname: AF_INET 0.0.0.0 port: 0

$lsof -p 21806
a.out 21806 lee 4u IPv4 0x30004d747c8 0t0 TCP *:11094
(LISTEN)
a.out 21806 lee 5u IPv4 0x30002e0b1f0 0t842 TCP
feed0:*->remote_peer.xxx.com:* (IDLE)
a.out 21806 lee 6u IPv4 0x30004905bd8 0t0 TCP *:10094
(LISTEN)
a.out 21806 lee 7u IPv4 0x30003d3ce60 0t842 TCP
feed0:*->remote_peer.xxx.com:* (IDLE)
a.out 21806 lee 8u IPv4 0x30003dda680 0t0 TCP
feed0:10094->remote_peer.xxx.com:60312 (CLOSE_WAIT)
a.out 21806 lee 9u IPv4 0x30004306cf0 0t842 TCP
feed0:*->remote_peer.xxx.com:* (IDLE)


I hate cross-post, but I have to post it on unix.solaris newsgroup
this time.

Thanks!

Lee