Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site edai.UUCP Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!floyd!vax135!ukc!edcaad!edee!edai!ok From: ok@edai.UUCP Newsgroups: net.bugs.uucp Subject: News 2.10 /usr/lib/news/recmail crashes Message-ID: <3949@edai.UUCP> Date: Sat, 21-Jan-84 16:10:31 EST Article-I.D.: edai.3949 Posted: Sat Jan 21 16:10:31 1984 Date-Received: Fri, 27-Jan-84 04:38:06 EST Organization: Art.Intelligence,Edin.Univ. Lines: 39 Every time I (try to) use the 'r'eply option of readnews, I arrive safely back at readnews prompt level having correctly produced a /tmp/pn????? file, and a few seconds later get a message on the screen "sh: bus error, core dumped" or something like that. I finally got annoyed enough to track the problem down. recmail.c has a section which looks roughly like this: FILE *fd; char *tmpf; char linebuf[1024]; ... tmpf = mktemp("/tmp/rmXXXXXX"); fd = fopen(tmpf, "w"); while (fgets(linebuf, sizeof linebuf, stdin) != NULL) { fputs(linebuf, fd); ... The immediate cause of the problem is the fputs call: fd is NULL! I am not all that charmed by recmail's failure to check that the fopen call worked. I am totally bewildered by the fact that fopen sometimes returns NULL here. The call to mktemp has in fact come up with a file name which I can create. I have tried to make this program fail on its own, and I can't. The only thing I can think of is *maybe* it is called from some process which has tied up all the channels available and isn't closing them when it forks? In any case, does anyone know how to fix this problem? (We're running 4.1bsd in case it matters.) There's another problem with this version of recmail: it never ever removes the /tmp/rm?????? file it creates. The only thing that stops it clogging up /tmp is that it never succeeds in creating the file. Or is there a hack for that in some other program in the news suite? Just for completing ones losses, the /tmp/pn????? file IS removed, so that if you want to mail the article by hand, you have to re-enter it. Nice one!