[comp.mail.sendmail] sendmail 5.64 dumps core

tgp@sei.cmu.edu (Tod Pike) (07/06/90)

  I've been having a strange problem with sendmail for quite a while now.
About once every two or three days, I'll notice a core dump from sendmail in
my spool area.  Looking in with dbx, sendmail is dumping in the reply function
in usersmtp.c.  The actual line is the "(void) fflush(SmtpOut);" line.  Now
the value of SmtpOut is 0, but I can't easily determine whether that is really
bogus or not.

  The configuration is a Sun running SunOS 4.0, and Sendmail V5.64.  I have
seen the same problem running sendmail V5.62, but I was hoping it would go
away when I moved to 5.64.

  Any pointers to the cause of the problem would be greatly appreciated.

			Tod Pike

-- 
Internet: tgp@sei.cmu.edu
Mail:     Carnegie Mellon University
	  Software Engineering Institute
	  Pittsburgh, PA. 15213-3980

steve@fnord.umiacs.umd.edu (Steve D. Miller) (07/11/90)

I'm pretty sure I've seen this problem before.  I think that what happens is
that the connection craps out after the MAIL FROM command.  The first
RCPT TO notes that the connection has gone, and closes the socket.  If
there's multiple recipients at that same host, however, sendmail tries
to do a second RCPT TO, and ends up calling reply(), which does a fflush
on SmtpOut, which is sort of a null pointer...

This is the way I fixed this problem here, though I'm not convinced that
it's the best way to do so.  This change is to usersmtp.c.

	-Steve

Spoken: Steve Miller    Domain: steve@umiacs.umd.edu    UUCP: uunet!mimsy!steve
Phone: +1-301-454-1808  USPS: UMIACS, Univ. of Maryland, College Park, MD 20742

*** /tmp/,RCSt1a03798	Tue Jul 10 13:17:47 1990
--- /tmp/,RCSt2a03798	Tue Jul 10 13:17:47 1990
***************
*** 241,246 ****
--- 241,251 ----
  	register int r;
  	extern char *remotename();
  
+ 	/* if the connection is closed, don't bother */
+ 	if (SmtpOut == NULL || SmtpIn == NULL) {
+ 		errno = EBADF;		/* guess */
+ 		return(EX_TEMPFAIL);
+ 	}
  	smtpmessage("RCPT To:<%s>", m, remotename(to->q_user, m, FALSE, TRUE));
  
  	SmtpPhase = "RCPT wait";
--
Spoken: Steve Miller    Domain: steve@umiacs.umd.edu    UUCP: uunet!mimsy!steve
Phone: +1-301-454-1808  USPS: UMIACS, Univ. of Maryland, College Park, MD 20742