Re: [exim] segfault in smtp.c, first_addr == NULL

Top Page
Delete this message
Reply to this message
Author: Jeremy Harris
Date:  
To: exim-users
Subject: Re: [exim] segfault in smtp.c, first_addr == NULL
On 31/01/2019 15:47, Ian Jackson via Exim-users wrote:
> I am having some trouble with a listserver running Exim. Exim is
> segfaulting. It is crashing here:
>
>       if (rc == DEFER && first_addr->basic_errno != ERRNO_AUTHFAIL
>                     && first_addr->basic_errno != ERRNO_TLSFAILURE)
>         write_logs(first_addr, host);

>
> because rc==DEFER and first_addr==NULL.


(transport/smtp.c about line 5116)

> I read prepare_addresses and
> it appears that prepare_addresses could return NULL if all the
> addresses were PENDING_DEFER.


Any time there was no address in DEFER state, as I read it. Do you
have some reason to pick PENDING_DEFER ?

>From the comment just before the loop starting 4702

(looping to handle cutoff_retry; within that, loop over
the host list trying to send the addrlist to each host)
the PENDING_DEFER state is transient within each host iteration,
flagging those addrs being attmpted.

Are you thinking the flagging isn't cleared?

It's annoying we don't see evidence of the crash in the debug
output. I'd expect the parent of the transport process to report
the SISEGV. but we don't see beyond the transport closing a
connection. We can't trust, from that, that the crash occurred
at that time.
It's interesting that the hosts_max_try limit has
just been reached with this last host; that would be reason for
leaving the hosts loop. It's also the first to give 4xx for a banner;
the previous were all 5xx - though I don't see how that could be a
factor.
--
Cheers,
Jeremy