[exim-dev] [Bug 1282] New: ident callback timeout steps on h…

Top Page
Delete this message
Reply to this message
Author: Don Craig
Date:  
To: exim-dev
New-Topics: [exim-dev] [Bug 1282] ident callback timeout steps on host lookup, [exim-dev] [Bug 1282] ident callback timeout steps on host lookup, [exim-dev] [Bug 1282] ident callback timeout steps on host lookup, [exim-dev] [Bug 1282] ident callback timeout steps on host lookup
Subject: [exim-dev] [Bug 1282] New: ident callback timeout steps on host lookup
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1282
           Summary: ident callback timeout steps on host lookup
           Product: Exim
           Version: 4.80
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Networking
        AssignedTo: nigel@???
        ReportedBy: dmc@???
                CC: exim-dev@???



Problem occurs with at least Exim 4.77 and 4.80, Centos 5.8 (Final). "no IP
address found for host" logged during inbound SMTP connection - including from
localhost. Spent much time verifying DNS - forward and backward lookups working
fine. Debug statements in exim/host.c indicated two calls to gethostbyname, one
with a null pointer - adding more debug statements then showed one call to
gethostbyname but two returns. So moving code around changed the symptoms.
exim.conf had:
host_lookup = *
and
rfc1413_query_timeout = 3s

Changing rfc1413_query_timeout to 0s cleared the problem.

Here is the relevant changed code fragment from host.c, followed by the output
from exim -bd -d+dns+resolver+host_lookup.

My guess is that the ident timeout callback is either stepping on the static
variables involved in calling and returning from gethostbyname, or there's some
other messy interaction with the callback. The debugging statement results were
inconsistent when the code was changed, indicating some kind of multi-threading
issue.

host.c, line 1978 or so:
  if (running_in_test_harness)
    hostdata = host_fake_gethostbyname(host->name, AF_INET, &error_num);
  else
    {
    if( CS host->name )
      if( Ustrlen(CS host->name) )
        DEBUG(D_host_lookup) debug_printf("calling gethostbyname with %s\n", CS
host->name);
      else
        DEBUG(D_host_lookup) debug_printf("calling gethostbyname with zero
length string\n" );
    else
      DEBUG(D_host_lookup) debug_printf("calling gethostbyname with NULL
pointer\n" );
    hostdata = gethostbyname(CS host->name);
    error_num = h_errno;
    DEBUG(D_host_lookup) debug_printf("hostdata returned %s, h_errno returned
%d\n",
        hostdata ? "not NULL" : "NULL", error_num );
    }


10929 Listening...
10941 DNS lookup of 58.82.203.193.in-addr.arpa (PTR) succeeded
10941 IP address lookup yielded email.sohonet.co.uk
10941 calling gethostbyname with email.sohonet.co.uk
10941 hostdata returned not NULL, h_errno returned 1
10941 gethostbyname looked up these IP addresses:
10941 name=email.sohonet.co.uk address=193.203.82.58
10941 checking addresses for email.sohonet.co.uk
10941 193.203.82.58 OK
10941 sender_fullhost = email.sohonet.co.uk [193.203.82.58]:48865
10941 sender_rcvhost = email.sohonet.co.uk ([193.203.82.58]:48865)
10941 host in rfc1413_hosts? yes (matched "*")
10941 doing ident callback
10941 LOG: MAIN
10941 ident connection to 193.203.82.58 timed out
10941 sender_fullhost = email.sohonet.co.uk [193.203.82.58]:48865
10941 sender_rcvhost = email.sohonet.co.uk ([193.203.82.58]:48865)
10941 Process 10941 is handling incoming connection from email.sohonet.co.uk
[193.203.82.58]:48865
10941 checking for IP options
10941 no IP options found
10941 host in host_lookup? yes (matched "*")
10941 calling host_name_lookup from smtp_in.c reference one
10941 looking up host name for 193.203.82.58
10941 DNS lookup of 58.82.203.193.in-addr.arpa (PTR) succeeded
10941 IP address lookup yielded email.sohonet.co.uk
10941 alias
10941 calling gethostbyname with email.sohonet.co.uk
10941 hostdata returned not NULL, h_errno returned 1
10941 gethostbyname looked up these IP addresses:
10941 name=email.sohonet.co.uk address=193.203.82.58
10941 checking addresses for email.sohonet.co.uk
10941 193.203.82.58 OK
10941 hostdata returned NULL, h_errno returned 1
10941 gethostbyname returned 1 (HOST_NOT_FOUND)
10941 no IP address found for host (during SMTP connection from
email.sohonet.co.uk [193.203.82.58]:48865 I=[192.168.1.8]:25)
10941 LOG: host_lookup_failed MAIN
10941 no IP address found for host (during SMTP connection from
email.sohonet.co.uk [193.203.82.58]:48865 I=[192.168.1.8]:25)
10941 no IP addresses found for
10941 sender_fullhost = email.sohonet.co.uk [193.203.82.58]:48865
10941 sender_rcvhost = email.sohonet.co.uk ([193.203.82.58]:48865)


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email