Re: [exim] Exim core dump

Top Page
Delete this message
Reply to this message
Author: Alex Kiernan
Date:  
To: exim-users
Subject: Re: [exim] Exim core dump
On 18/10/2007, Alex Kiernan <alex.kiernan@???> wrote:
> We've just rolled out a new box and we're getting core dumps from exim
> 4.68 on Solaris 10 x86 (two in 24 hours, so its not like its all the
> time) - I'm 99% certain this is the problem:
>
> --- host.c      11 Jan 2007 13:51:00 +0000      1.1.1.28
> +++ host.c      18 Oct 2007 09:57:02 +0100
> @@ -1502,7 +1502,7 @@
>  treat this as non-existent. In some operating systems, this is returned as an
>  empty string; in others as a single dot. */

>
> -if (hosts->h_name[0] == 0 || hosts->h_name[0] == '.')
> +if (hosts->h_name == NULL || hosts->h_name[0] == 0 || hosts->h_name[0] == '.')
>   {
>   HDEBUG(D_host_lookup) debug_printf("IP address lookup yielded an
> empty name: "
>     "treated as non-existent host name\n");

>
> But I've not tested it yet as I can't for the life of me work out in
> what circumstances that situation should occur (and my x86 stack
> tracing isn't up to the job...)
>


Okay... I figured out the address, and its definitely this:

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>

int main(void)
{
struct in_addr addr;
struct hostent *hosts;

addr.s_addr = inet_addr("91.186.12.143");
hosts = gethostbyaddr(&addr, sizeof(addr), AF_INET);
printf("hosts=%lx\n", hosts);
printf("hosts->h_name=%lx\n", hosts->h_name);
printf("hosts->h_name='%s'\n", hosts->h_name);
}

gives:

hosts=80609b4
hosts->h_name=0
Segmentation Fault (core dumped)

Still no idea why hosts->h_name is NULL on this particular box -
another not quite as patched box comes back with a pointer to an empty
string. Never the less the patch above seems like it ought to be
correct.

--
Alex Kiernan