From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 Description of problem: after operating on mm the program segfaults. It does not happen, if the current directory is not writable, but if it is, here's the strace output: open("mm", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3 fcntl(3, F_GETFL) = 0x8401 (flags O_WRONLY|O_APPEND|O_LARGEFILE|0x8000) fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a9556b000 lseek(3, 0, SEEK_CUR) = 0 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Version-Release number of selected component (if applicable): 8.1.1-29 How reproducible: Always Steps to Reproduce: 1.type mail <any address> 2.enter subject 3.enter body and Ctrl-D 4. type Enter at the CC: prompt Voila Actual Results: segfault Expected Results: mail sent Additional info:
/bin/mail is not really updated to current standards as a full email client. It is better to use mutt/mozilla or other more maintained apps for this. greetings, Florian La Roche
Please, PLEASE also think in automated large scale and the most important thing: EXISTING and LIVING environments. To send a mail automatically there is nothing simpler than piping into /bin/mail or /bin/mailx. And in existing environments there are probably thousands of scripts sending mail and they should also work in the future. So i guess i have to do the analysis myself. Anyway, no problem, but i hope, that when i find the problem, the fix will be incorporated.
/bin/mail should work fine to pipe into, but not as a full email client. You seem to be using the severn beta, you might also want to check the "taroon" beta, which might be a bit more stable for x86_64. At least invoking /bin/mail and piping into it seems to work fine for me. greetings, Florian La Roche
found it. seems to be a bug in the /usr/include/time.h header or some subtle preprocessor definition in the mailx sources. Problem is, that the declaration of ctime is not known in send.c. Adding the following line to extern.h (hack) solves the problem: extern char * ctime (__const time_t *); If this declaration is not known, the compiler assumes a return type of int, what is a 4 byte type while pointers are 8 byte. Boom. Pushing send.c through the cpp results in an output, where the last line from /usr/include/time.h is #122. The struct timespec is the last thing i see, the following struct tm stuff is already gone, don't know why.
Additional info: creating a file that only contains #include <time.h> and running cpp on it the resulting output WILL contain the ctime declaration (!?!)
Additional Info: it has to do with the header files, especially the _TIME_H definition. _TIME_H will under some circumstances not be defined (see /usr/include/time.h:25) this is true, if sys/params.h is included before sys/time.h The problem can also be solved changing the first 3 includes in def.h from: #include <sys/param.h> #include <sys/stat.h> #include <sys/time.h> #include <time.h> #include <sys/param.h> #include <sys/stat.h> but IMHO mailx should be a good guy and use autoconf ... there all the trouble with time.h and sys/time.h is already caught.
New rpms with your fix are on http://people.redhat.com/laroche/ Thanks a lot for working on this, Florian La Roche