X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=jiA wx6tEDzxV+mKoRPfHiZ7+1NT3l2MoG1Ahc1qlgIqPA1gn/xAFyc9sigzXqbwVKiK jLR6lb6vRgh3+j+F0yHDYcVRodfXbE1aqV/jgdmeXC6q5h57Fhg6RhyANTEVtokf FoHAfEdYuIypNf+Jsm2Q62KYf5cI1iEgKb8PdRBE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=XYpbRKB2P vH0+32E6lFA7CgJpPI=; b=bwhcV7liFwNN95mbnrK9LKgXLF2K4QwX4teIeZS+o rIsT2G2eInBbGxfIGmV+DlvU8L7y1f3oR9XO4iugM49VNJKKo2I3qzCKb2pwLClB /1wlO1MUhPC0op3lzG2Gt/WjAOiwmQugwTfHs729Hd1Wm4RW1NgGRqo9vwEnrh5Z W8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: "D. Boland" Subject: syslog function: Bad file descriptor Date: Tue, 05 Aug 2014 18:28:24 +0200 Lines: 103 Message-ID: <53E10628.3C42FD6F@boland.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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