[comp.sys.alliant] sendmail 5.65 works

eschle@forty2.physik.unizh.ch (Patrik Eschle) (11/15/90)

With the help of Jay Liang <jay@uokmax.ecn.uoknor.edu> who sent me an
article by Piet Beertema I was able to get sendmail 5.65 running - thanks
to both.

This is Piet's article Jay sent me:

-----

>From: piet@cwi.nl (Piet Beertema)
Newsgroups: comp.mail.sendmail
Subject: sendmail-5.64 problem (+ fix)
Keywords: core dump, malloc
Message-ID: <2043@charon.cwi.nl>
Date: 31 Aug 90 20:21:11 GMT
Sender: news@cwi.nl
Organization: CWI, Amsterdam
Lines: 27

Whereas on several systems (SUNs, Encore, HCX) it was quite
straightforward to get sendmail-5.64 (plus IDA-1.3.1) to run,
I had serious problems getting it to work on an Alliant FX/4:
it dumped core when the frozen config file was used; without
the frozen config it worked okay. sendmail-5.61/IDA had given
no problems on any of these systems.

The problem could be tracked down to a small difference between
5.61 and 5.64, but a very dangerous one:

main() calls setdefaults() prior to thawing the frozen config
or reading the config file (and freezing it). New in 5.64 is
that setdefaults() calls setdefuser(), which via the newstr()
macro calls malloc().
When using the frozen config, this happens *before* the frozen
config is read; after reading the frozen config, the malloc
structure *may* then be messed up, depending on the malloc()
implementation. That was apparently the case on the Alliant.

Since setdefuser() needs to be called only just prior to reading
(and perhaps freezing) the config file, the fix is simple:
- delete the setdefuser() call from setdefaults() in conf.c
- add a setdefuser() call at the start of readcf() in readcf.c


-- 
Patrik Eschle, Physics Institute University of  Zuerich (Switzerland)
inet: eschle@physik.unizh.ch (bang: uunet!chx400!forty2!eschle)
      "Payless Physics -- now opening at the Uni Zuerich!"
          -> Send CHUUG mail to chuug@chuug.uu.ch <-