[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bad file descriptor. Ktrace.



I often get a message saying Bad file descriptor while connecting 
with sup or connecting to a irc server with epic. It seems to happen 
when opening new socket but i may be wrong. I changed #define 
FD_SIZELIMIT to 1024 in /usr/src/sys/sys/types.h but no help.
I have been fighting with it for days now but i got completely no 
idea.
Attaching part of ktrace of epic and full ktrace of sup.
Thanks

EPIC KTRACE

 15251 epic-EPIC4-1.0.1 RET   write 2
 15251 epic-EPIC4-1.0.1 CALL  setitimer(0,0xdfbfd950,0xdfbfd940)
 15251 epic-EPIC4-1.0.1 RET   setitimer 0
 15251 epic-EPIC4-1.0.1 CALL  close(0x3)
 15251 epic-EPIC4-1.0.1 RET   close 0
 15251 epic-EPIC4-1.0.1 CALL  close(0x3)
 15251 epic-EPIC4-1.0.1 RET   close -1 errno 9 Bad file descriptor
 15251 epic-EPIC4-1.0.1 CALL  issetugid
 15251 epic-EPIC4-1.0.1 RET   issetugid 0
 15251 epic-EPIC4-1.0.1 CALL  open(0xdfbfd5d0,0,0x89)
 15251 epic-EPIC4-1.0.1 NAMI  "/usr/share/nls/C/libc.cat"
 15251 epic-EPIC4-1.0.1 RET   open 3
 15251 epic-EPIC4-1.0.1 CALL  fstat(0x3,0xdfbfd530)
 15251 epic-EPIC4-1.0.1 RET   fstat 0
 15251 epic-EPIC4-1.0.1 CALL  mmap(0,0xe5a,0x1,0x1,0x3,0,0,0)
 15251 epic-EPIC4-1.0.1 RET   mmap 1075404800/0x40196000
 15251 epic-EPIC4-1.0.1 CALL  close(0x3)
 15251 epic-EPIC4-1.0.1 RET   close 0
 15251 epic-EPIC4-1.0.1 CALL  munmap(0x40196000,0xe5a)
 15251 epic-EPIC4-1.0.1 RET   munmap 0
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x70)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 112 bytes
       "\^[[2;1H\^[[K*** Unable to connect to port 6667 of server 
irc.efnet.pl\
	: Bad file descriptor\^[[m\^O\^[[m\^[[m\^[[m\^O\^[[m\^[[m\^[[K\r
       "
 15251 epic-EPIC4-1.0.1 RET   write 112/0x70
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x60)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 96 bytes
       "\^[[3;1H\^[[K*** Sorry, cannot connect.  Use /SERVER to 
connect to a s\
	erver\^[[m\^O\^[[m\^[[m\^[[m\^O\^[[m\^[[m\^[[K\r
       "
 15251 epic-EPIC4-1.0.1 RET   write 96/0x60
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x7)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 7 bytes
       "\^[[24;3H"
 15251 epic-EPIC4-1.0.1 RET   write 7
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfdb78,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x27)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 39 bytes
       "\^[[24;1H> 
\^[[m\^O\^[[m\^[[m\^[[m\^O\^[[m\^[[m\^[[K\^[[24;3H"
 15251 epic-EPIC4-1.0.1 RET   write 39/0x27
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfdb28,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  select(0x1,0xdfbfdb60,0,0,0xdfbfdb08)
 15251 epic-EPIC4-1.0.1 RET   select 1
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfb2e8,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  read(0,0xdfbfb328,0x800)
 15251 epic-EPIC4-1.0.1 GIO   fd 0 read 1 bytes
       "/"
 15251 epic-EPIC4-1.0.1 RET   read 1
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x1)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 1 bytes
       "/"
 15251 epic-EPIC4-1.0.1 RET   write 1
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfdb28,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfdb28,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  select(0x1,0xdfbfdb60,0,0,0xdfbfdb08)
 15251 epic-EPIC4-1.0.1 RET   select 1
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfb2e8,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  read(0,0xdfbfb328,0x800)
 15251 epic-EPIC4-1.0.1 GIO   fd 0 read 4 bytes
       "quit"
 15251 epic-EPIC4-1.0.1 RET   read 4
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x1)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 1 bytes
       "q"
 15251 epic-EPIC4-1.0.1 RET   write 1
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x1)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 1 bytes
       "u"
 15251 epic-EPIC4-1.0.1 RET   write 1
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x1)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 1 bytes
       "i"
 15251 epic-EPIC4-1.0.1 RET   write 1
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x1)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 1 bytes
       "t"
 15251 epic-EPIC4-1.0.1 RET   write 1
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfdb28,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfdb28,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  select(0x1,0xdfbfdb60,0,0,0xdfbfdb08)
 15251 epic-EPIC4-1.0.1 RET   select 1
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfb2e8,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  read(0,0xdfbfb328,0x800)
 15251 epic-EPIC4-1.0.1 GIO   fd 0 read 1 bytes
       "
       "
 15251 epic-EPIC4-1.0.1 RET   read 1
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x27)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 39 bytes
       "\^[[24;1H> 
\^[[m\^O\^[[m\^[[m\^[[m\^O\^[[m\^[[m\^[[K\^[[24;3H"
 15251 epic-EPIC4-1.0.1 RET   write 39/0x27
 15251 epic-EPIC4-1.0.1 CALL  gettimeofday(0xdfbfa7b8,0)
 15251 epic-EPIC4-1.0.1 RET   gettimeofday 0
 15251 epic-EPIC4-1.0.1 CALL  ioctl(0,TIOCSETAW,0x84400)
 15251 epic-EPIC4-1.0.1 RET   ioctl 0
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x12)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 18 bytes
       "\r\^[[K\^[[1;24r\^[[24;1H"
 15251 epic-EPIC4-1.0.1 RET   write 18/0x12
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x7)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 7 bytes
       "\^[[24;3H"
 15251 epic-EPIC4-1.0.1 RET   write 7
 15251 epic-EPIC4-1.0.1 CALL  write(0x1,0x97000,0x1)
 15251 epic-EPIC4-1.0.1 GIO   fd 1 wrote 1 bytes
       "\r"
 15251 epic-EPIC4-1.0.1 RET   write 1
 15251 epic-EPIC4-1.0.1 CALL  exit(0)

SUP KTRACE
  1547 ktrace   RET   ktrace 0
  1547 ktrace   CALL  execve(0xdfbfd704,0xdfbfdbfc,0xdfbfdc0c)
  1547 ktrace   NAMI  "/usr/bin/sup"
  1547 sup      EMUL  "native"
  1547 sup      RET   execve 0
  1547 sup      CALL  open(0x10b1,0,0)
  1547 sup      NAMI  "/usr/libexec/ld.so"
  1547 sup      RET   open 3
  1547 sup      CALL  read(0x3,0xdfbfdba8,0x20)
  1547 sup      GIO   fd 3 read 32 bytes
       "\M-@\M^F\^A\v\0\M-P\0\0\0 \0\0\0\0\0\0\0\0\0\0 
\0\0\0\0\0\0\0\0\0\0\0"
  1547 sup      RET   read 32/0x20
  1547 sup      CALL  mmap(0,0xf000,0x5,0x2,0x3,0,0,0)
  1547 sup      RET   mmap 1073807360/0x40010000
  1547 sup      CALL  mmap(0x4001d000,0x2000,0x3,0x12,0x3,0,0xd000,0)
  1547 sup      RET   mmap 1073860608/0x4001d000
  1547 sup      CALL  getuid
  1547 sup      RET   getuid 0
  1547 sup      CALL  geteuid
  1547 sup      RET   geteuid 0
  1547 sup      CALL  getgid
  1547 sup      RET   getgid 0
  1547 sup      CALL  getegid
  1547 sup      RET   getegid 0
  1547 sup      CALL  
__sysctl(0xdfbfda48,0x2,0x4001e450,0xdfbfda44,0,0)
  1547 sup      RET   __sysctl 0
  1547 sup      CALL  mmap(0,0x8000,0x3,0x1004,0xffffffff,0,0,0)
  1547 sup      RET   mmap 1073868800/0x4001f000
  1547 sup      CALL  open(0x4001194f,0,0)
  1547 sup      NAMI  "/var/run/ld.so.hints"
  1547 sup      RET   open 4
  1547 sup      CALL  mmap(0,0x1000,0x1,0x4,0x4,0,0,0)
  1547 sup      RET   mmap 1073901568/0x40027000
  1547 sup      CALL  mmap(0x40028000,0x1a3,0x1,0x14,0x4,0,0x1000,0)
  1547 sup      RET   mmap 1073905664/0x40028000
  1547 sup      CALL  open(0x40027ac3,0,0)
  1547 sup      NAMI  "/usr/lib/libc.so.28.0"
  1547 sup      RET   open 5
  1547 sup      CALL  read(0x5,0xdfbfdaa0,0x20)
  1547 sup      GIO   fd 5 read 32 bytes
       "\M-@\M^F\^A\v\0\M-p\a\0\0\M^P\0\0\M-@\M-g\^B\08F\0\0 
\0\0\0\0\0\0\0\0\
	\0\0\0"
  1547 sup      RET   read 32/0x20
  1547 sup      CALL  mmap(0,0xb67c0,0x5,0x4,0x5,0,0,0)
  1547 sup      RET   mmap 1073909760/0x40029000
  1547 sup      CALL  mprotect(0x400a8000,0x9000,0x7)
  1547 sup      RET   mprotect 0
  1547 sup      CALL  
mmap(0x400b1000,0x2e7c0,0x7,0x1014,0xffffffff,0,0,0)
  1547 sup      RET   mmap 1074466816/0x400b1000
  1547 sup      CALL  close(0x5)
  1547 sup      RET   close 0
  1547 sup      CALL  munmap(0x40027000,0x1000)
  1547 sup      RET   munmap 0
  1547 sup      CALL  close(0x4)
  1547 sup      RET   close 0
  1547 sup      CALL  close(0x3)
  1547 sup      RET   close 0
  1547 sup      CALL  readlink(0x4009536e,0xdfbfda4c,0x3f)
  1547 sup      NAMI  "/etc/malloc.conf"
  1547 sup      RET   readlink -1 errno 2 No such file or directory
  1547 sup      CALL  issetugid
  1547 sup      RET   issetugid 0
  1547 sup      CALL  mmap(0,0x1000,0x3,0x1002,0xffffffff,0,0,0)
  1547 sup      RET   mmap 1073901568/0x40027000
  1547 sup      CALL  break(0x12dd4)
  1547 sup      RET   break 0
  1547 sup      CALL  break(0x12dd4)
  1547 sup      RET   break 0
  1547 sup      CALL  break(0x14000)
  1547 sup      RET   break 0
  1547 sup      CALL  break(0x14000)
  1547 sup      RET   break 0
  1547 sup      CALL  break(0x15000)
  1547 sup      RET   break 0
  1547 sup      CALL  getlogin(0x400d4a10,0x20)
  1547 sup      RET   getlogin 0
  1547 sup      CALL  open(0xdfbfdc5f,0,0x1b6)
  1547 sup      NAMI  "/open/anoncvs/sup/ss"
  1547 sup      RET   open 3
  1547 sup      CALL  fstat(0x3,0xdfbfc9ec)
  1547 sup      RET   fstat 0
  1547 sup      CALL  break(0x15000)
  1547 sup      RET   break 0
  1547 sup      CALL  break(0x17000)
  1547 sup      RET   break 0
  1547 sup      CALL  read(0x3,0x15000,0x2000)
  1547 sup      GIO   fd 3 read 78 bytes
       " host=anoncvs1.ca.openbsd.org hostbase=/usr/OpenBSD 
base=/open/anoncvs\
	 delete
       "
  1547 sup      RET   read 78/0x4e
  1547 sup      CALL  break(0x17000)
  1547 sup      RET   break 0
  1547 sup      CALL  break(0x18000)
  1547 sup      RET   break 0
  1547 sup      CALL  read(0x3,0x15000,0x2000)
  1547 sup      RET   read 0
  1547 sup      CALL  close(0x3)
  1547 sup      RET   close 0
  1547 sup      CALL  gettimeofday(0xdfbfcaf4,0)
  1547 sup      RET   gettimeofday 0
  1547 sup      CALL  access(0x40085590,0x4)
  1547 sup      NAMI  "/etc/localtime"
  1547 sup      RET   access 0
  1547 sup      CALL  open(0x40085590,0,0)
  1547 sup      NAMI  "/etc/localtime"
  1547 sup      RET   open 3
  1547 sup      CALL  read(0x3,0xdfbfa6e0,0x1f08)
  1547 sup      GIO   fd 3 read 56 bytes
       
"TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^A\0\0\0\^A\0\0\0\0\0\0\0\
0\
	\0\0\0\^A\0\0\0\^D\0\0\0\0\0\0GMT\0\0\0"
  1547 sup      RET   read 56/0x38
  1547 sup      CALL  close(0x3)
  1547 sup      RET   close 0
  1547 sup      CALL  fstat(0x1,0xdfbfbf6c)
  1547 sup      RET   fstat 0
  1547 sup      CALL  write(0x1,0x15000,0x44)
  1547 sup      GIO   fd 1 wrote 68 bytes
       "SUP 8.26 (4.3 BSD) for file /open/anoncvs/sup/ss at Jan 31 
21:18:00
       "
  1547 sup      RET   write 68/0x44
  1547 sup      CALL  sigaction(0xd,0xdfbfdb50,0)
  1547 sup      RET   sigaction 0
  1547 sup      CALL  open(0xdfbfd33c,0,0x1b6)
  1547 sup      NAMI  "/usr/lib/supfiles/coll.host"
  1547 sup      RET   open 3
  1547 sup      CALL  fstat(0x3,0xdfbfd1ec)
  1547 sup      RET   fstat 0
  1547 sup      CALL  break(0x18000)
  1547 sup      RET   break 0
  1547 sup      CALL  break(0x1a000)
  1547 sup      RET   break 0
  1547 sup      CALL  read(0x3,0x18000,0x2000)
  1547 sup      GIO   fd 3 read 24 bytes
       "anoncvs1.ca.openbsd.org
       "
  1547 sup      RET   read 24/0x18
  1547 sup      CALL  write(0xffffffff,0x11c68,0x29)
  1547 sup      RET   write -1 errno 9 Bad file descriptor
  1547 sup      CALL  write(0x2,0xdfbfc354,0x5)
  1547 sup      GIO   fd 2 wrote 5 bytes
       "SUP: "
  1547 sup      RET   write 5
  1547 sup      CALL  write(0x2,0xdfbfc384,0x16)
  1547 sup      GIO   fd 2 wrote 22 bytes
       "Write error on network"
  1547 sup      RET   write 22/0x16
  1547 sup      CALL  issetugid
  1547 sup      RET   issetugid 0
  1547 sup      CALL  open(0xdfbfc5c8,0,0x177)
  1547 sup      NAMI  "/usr/share/nls/C/libc.cat"
  1547 sup      RET   open 4
  1547 sup      CALL  fstat(0x4,0xdfbfc528)
  1547 sup      RET   fstat 0
  1547 sup      CALL  mmap(0,0xe5a,0x1,0x1,0x4,0,0,0)
  1547 sup      RET   mmap 1074659328/0x400e0000
  1547 sup      CALL  close(0x4)
  1547 sup      RET   close 0
  1547 sup      CALL  munmap(0x400e0000,0xe5a)
  1547 sup      RET   munmap 0
  1547 sup      CALL  write(0x2,0xdfbfc344,0x16)
  1547 sup      GIO   fd 2 wrote 22 bytes
       ": Bad file descriptor
       "
  1547 sup      RET   write 22/0x16
  1547 sup      CALL  read(0x3,0x18000,0x2000)
  1547 sup      RET   read 0
  1547 sup      CALL  close(0x3)
  1547 sup      RET   close 0
  1547 sup      CALL  write(0x2,0xdfbfc404,0x40)
  1547 sup      GIO   fd 2 wrote 64 bytes
       "SUP: Host for collection host=anoncvs1.ca.openbsd.org not 
found
       "
  1547 sup      RET   write 64/0x40
  1547 sup      CALL  write(0x1,0x15000,0x23)
  1547 sup      GIO   fd 1 wrote 35 bytes
       "SUP: error in collection/host file
       "
  1547 sup      RET   write 35/0x23
  1547 sup      CALL  write(0x2,0xdfbfc3f4,0x29)
  1547 sup      GIO   fd 2 wrote 41 bytes
       "SUP: Hosts not found for all collections
       "
  1547 sup      RET   write 41/0x29
  1547 sup      CALL  exit(0x1)


-- 
Adam Naguszewski, admin@bmtmc.gda.pl on 2002-02-01