This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

syslog function: Bad file descriptor


Hi group,

I'm still working on getting Sendmail working for Cygwin. I'm almost done, the devil
is in the details...

I'm getting the 'Bad file descriptor' system error after building the mail aliases
database. The building itself is done successful, but logging the event to the
system log fails with this message.

Somehow the two are connected. The alias database (aliases.db) is built from a plain
text file (aliases). If I leave the aliases file writable to the sendmail user, I
find that the error message strings have been put right into the alias text-file:

$ cat /etc/mail/aliases
<21>sendmail: PID 1848: alias database /etc/mail/aliases rebuilt by smmspsenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: SYSTEM
<22>sendmail: PID 1848: /etc/mail/aliases: 9 aliases, longest 6 bytes, 82 bytes
total

If I make the 'aliases' file read-only, then the file is not corrupted, but the
error occurs.

Cheers,
Daniel

Here's the strace output. I copied the lines between two subsequent calls to
'syslog':

strace /usr/sbin/sendmail -bi

syslog: Bad file descriptor
  145 16951672 [main] sendmail 1104 write: 28 = write(1, 0x2007EFB0, 28)
  131 16951803 [main] sendmail 1104 cygpsid::debug_print: get_sids_info: owner SID =
S-1-5-21-1659004503-813497703-854245398-1028
   56 16951859 [main] sendmail 1104 cygpsid::debug_print: get_sids_info: group SID =
S-1-5-21-1659004503-813497703-854245398-1029
   55 16951914 [main] sendmail 1104 get_info_from_sd: ACL 0x120, uid 1028, gid 1029
   74 16951988 [main] sendmail 1104 fhandler_base::fstat_helper: 0 = fstat
(\??\C:\cygwin\etc\mail\aliases, 0x228A10) st_size=183, st_mode=0x8120,
st_ino=1970324837070571st_atim=53E0FB5C.120ACC80 st_ctim=53E0FB59.1859C3C0
st_mtim=53E0FB4E.205C2E00 st_birthtim=53DE6678.2B7D5340
   68 16952056 [main] sendmail 1104 fstat64: 0 = fstat(3, 0x228A10)
   76 16952132 [main] sendmail 1104 read: read(3, 0x2008EFB8, 65536) blocking
   73 16952205 [main] sendmail 1104 fhandler_base::read: returning 183, binary mode
   50 16952255 [main] sendmail 1104 read: 183 = read(3, 0x2008EFB8, 65536)
  333 16952588 [main] sendmail 1104 fhandler_disk_file::pread: 16384 =
pread(0x2004D9D4, 16384, 32768)
   63 16952651 [main] sendmail 1104 pread: 16384 = pread(6, 0x2004D9D4, 16384,
32768)
  345 16952996 [main] sendmail 1104 fhandler_disk_file::pread: 16384 =
pread(0x2009EFFC, 16384, 16384)
   58 16953054 [main] sendmail 1104 pread: 16384 = pread(6, 0x2009EFFC, 16384,
16384)
 2580 16955634 [main] sendmail 1104 read: read(3, 0x2008EFB8, 65536) blocking
   69 16955703 [main] sendmail 1104 fhandler_base::read: returning 0, binary mode
   48 16955751 [main] sendmail 1104 read: 0 = read(3, 0x2008EFB8, 65536)
/etc/mail/aliases: 13 aliases, longest 10 bytes, 144 bytes total
  196 16955947 [main] sendmail 1104 write: 65 = write(1, 0x2007EFB0, 65)
   53 16956000 [main] sendmail 1104 vsyslog: 0x6 %s
  243 16956243 [main] sendmail 1104 open: open(/dev/null, 0x10601)
   51 16956294 [main] sendmail 1104 normalize_posix_path: src /dev/null
   71 16956365 [main] sendmail 1104 normalize_posix_path: /dev/null =
normalize_posix_path (/dev/null)
   50 16956415 [main] sendmail 1104 mount_info::conv_to_win32_path:
conv_to_win32_path (/dev/null)
   48 16956463 [main] sendmail 1104 mount_info::conv_to_win32_path: src_path
/dev/null, dst \Device\Null, flags 0x2, rc 0
   64 16956527 [main] sendmail 1104 build_fh_pc: fh 0x612AEC2C, dev 00010003
   51 16956578 [main] sendmail 1104 fhandler_base::open: (\Device\Null, 0x18601)
   61 16956639 [main] sendmail 1104 fhandler_base::set_flags: flags 0x18601,
supplied_bin 0x10000
   51 16956690 [main] sendmail 1104 fhandler_base::set_flags: O_TEXT/O_BINARY set in
flags 0x10000
   50 16956740 [main] sendmail 1104 fhandler_base::set_flags: filemode set to binary
   48 16956788 [main] sendmail 1104 fhandler_base::open: 0x0 = NtCreateFile (0x60C,
0x40120080, \Device\Null, io, NULL, 0x0, 0x7, 0x3, 0x4020, NULL, 0)
   52 16956840 [main] sendmail 1104 fhandler_base::open: 1 =
fhandler_base::open(\Device\Null, 0x18601)
   51 16956891 [main] sendmail 1104 open: 7 = open(/dev/null, 0x18601)
  190 16957081 [main] sendmail 1104 _cygwin_istext_for_stdio: fd 7: opened as binary
 1045 16958126 [main] sendmail 1104 write: write(7, 0x227B50, 10)
   49 16958175 [main] sendmail 1104 write: 10 = write(7, 0x227B50, 10)
  169 16958344 [main] sendmail 1104 getpid: 1104 = getpid()
  555 16958899 [main] sendmail 1104 write: write(7, 0x227B50, 10)
   47 16958946 [main] sendmail 1104 write: 10 = write(7, 0x227B50, 10)
  688 16959634 [main] sendmail 1104 write: write(7, 0x227B70, 64)
   49 16959683 [main] sendmail 1104 write: 64 = write(7, 0x227B70, 64)
  256 16959939 [main] sendmail 1104 close: close(7)
  440 16960379 [main] sendmail 1104 fhandler_base::close: closing '/dev/null' handle
0x60C
   36 16960415 [main] sendmail 1104 close: 0 = close(7)
  616 16961031 [main] sendmail 1104 getpid: 1104 = getpid()
   51 16961082 [main] sendmail 1104 __set_errno: ssize_t writev(int, const iovec*,
int):1318 setting errno 9
   53 16961135 [main] sendmail 1104 writev: -1 = writev(3, 0x2282B0, 2), errno 9
syslog: Bad file descriptor


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]