[Mimedefang] Stack overflow on Tru64 V4.0f

David Potterveld dhp at mep.phy.anl.gov
Mon Apr 25 11:53:10 EDT 2005


I finally got around to upgrading Mimedefang to 2.51 (from 2.28... 
please, no scolding!) on a Tru64 system, version 4.0f. It built fine, 
but the mimedefang process would crash with a SEGV trap when entering 
the sendmail (8.13.4) sm_snprintf routines. I tried a different 
replacement for snprintf, and the problem hopped to entry into rm_r, 
nested several times. After flailing around for a bit, I realized the 
stack for this thread was being entirely consumed. The stack limit on my 
system is 2 megs, and I couldn't figure out how to raise it. Instead, I 
changed the definitions for SMALLBUF and BIGBUF in mimedefang.h:

#if defined (__alpha) || defined (__ALPHA)  /* Hack for Tru64 */
#define SMALLBUF 4096
#define BIGBUF 32768
#else
#define SMALLBUF 8192
#define BIGBUF 65536
#endif /*ALPHA*/

Everything is working happily after halving these buffer sizes. 
Incidently, SMALLBUF was set to 4096 in mimedefang V2.28. I don't when 
it was made larger.

Is there any problem with decreaing these parameters in this way?

If it's OK, you might want to put a similar ifdef into a new release, 
for small-stack systems. (Together with an option in the config script.)

Can the stack usage grow arbitrarily depending on how busy mimedefang 
is, ie, how many concurrent milter threads and mimedefang slaves are 
operating? I don't want this to come back and bring things to a halt if 
the system gets very busy. Can mimedefang buffers be allocated off the 
stack?

David Potterveld
Argonne National Lab.



More information about the MIMEDefang mailing list