Re: [Exim] Silent crashes of 4.40

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Alexander Sabourenkov
CC: exim-users
Assumpte: Re: [Exim] Silent crashes of 4.40
On Wed, 21 Jul 2004, Alexander Sabourenkov wrote:

> I've been experiencing silent crashes of 4.40.
> In all cases a crash has been preceded by
>
> getsockname() failed: Connection reset by peer
>
> line in both main and panic logs.
>
> I suspect that the code at fault is:
>
> (daemon.c, around line 161)
>
> if (getsockname(accept_socket, (struct sockaddr *)(&interface_sockaddr),
>       &ifsize) < 0)
>    {
>    log_write(0, LOG_MAIN|LOG_PANIC, "getsockname() failed: %s",
>      strerror(errno));
>    smtp_printf("421 Local problem: getsockname() failed; please try again
> later\r\n");
>    goto ERROR_RETURN;
>    }

>
> Given the nature of the error, smtp_printf()-ing anything seems like a very
> bad idea.
>
> I've rolled out several instances with the smtp_printf() commented out, but
> haven't got any decisive results yet.


This code was introduced in release 4.21 with the following comment:

28. There was no check for failure on the call to getsockname() in the daemon
    code. This can fail if there is a shortage of resources on the system, with
    ENOMEM, for example. A temporary error is now given on failure.


Perhaps Exim should make the smtp_printf conditional on the error not
being network related. OTOH, it shouldn't crash. I have noted this for
further investigation in due course.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book