Re: local_scan is crashing on big messages

Marc MERLIN <[email protected]>
Newsgroups gmane.mail.exim.spamassassin
Message-ID <[email protected]>
On Mon, May 17, 2004 at 08:37:50AM -0400, Brian Kendig wrote:
> On May 15, 2004, at 1:44 PM, Marc MERLIN wrote:
> >Ok, that's great news, at least you can reproduce at will, it will 
> >help a
> >lot.
> >See what you get with a debuglevel of 10
> 
> Here's what I get in the mainlog with SAEximDebug set to 10:
> 
>   http://www.enchanter.net/sa-exim.debug
> 
> The relevant lines appear to be these; I'll bet it shouldn't be 
> reporting a message body of zero bytes:
> 
> SA: Debug4: Message body is about 0 bytes and the initial offset is 
> 4892260
> SA: Debug: SATruncBodyCond expand returned: '0'
> local_scan() function crashed with signal 11 - message temporarily 
> rejected (size 4892599)

Mmmh, interesting, so the code is this:
> if (SATruncBodyCond[0] != '1' || SATruncBodyCond[1] != 0)
> {
>     expand=expand_string(SATruncBodyCond);
>     if (expand == NULL)
>     {
> 	PANIC(string_sprintf("SATruncBodyCond expansion failure on %s", SATruncBodyCond));
>     }
> 
>     if (SAEximDebug)
>     {
> 	log_write(0, LOG_MAIN, "SA: Debug: SATruncBodyCond expand returned: '%s'", expand);
>     }
 
it worked up to here, but add this line here:
log_write(0, LOG_MAIN, "SA: Not Dead 0");

>     if (expand[0] == 0 || (expand[0] == '0' && expand[1] == 0))

this most likely worked, but the new log_writes will tell


would the following have crashed?
Try adding some debugs to check:

>     {

log_write(0, LOG_MAIN, "SA: Not Dead 1");
log_write(0, LOG_MAIN, "SA: size: %d", fdsize-18);
log_write(0, LOG_MAIN, "SA: mesgid: %s", safemesgid);
log_write(0, LOG_MAIN, "SA: mailinfo: %s", mailinfo);
log_write(0, LOG_MAIN, "SA: Not Dead 2");

> 	log_write(0, LOG_MAIN, "SA: Action: check skipped due to message size (%d bytes) and SATruncBodyCond expanded to false (Message-Id: %s). %s", fdsize-18, safemesgid, mailinfo);

log_write(0, LOG_MAIN, "SA: Not Dead 3");

> 	header_add(' ', "X-SA-Exim-Scanned: No (on %s); Message bigger than SAmaxbody (%d)\n", primary_hostname, SAmaxbody);

log_write(0, LOG_MAIN, "SA: Not Dead 4");

> 	return LOCAL_SCAN_ACCEPT;
>     }
> }

But by just looking at the code, I'm not quite sure why it'd crash there.
If you don't see "SA: Not Dead 0" and "...1", then I'll be very confused.

Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/   |   Finger [email protected] for PGP key
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.