Bug 150288 - Outgoing mail stuck with "impossible h_errno(0)"
Outgoing mail stuck with "impossible h_errno(0)"
Status: CLOSED DUPLICATE of bug 254501
Product: Fedora
Classification: Fedora
Component: bind (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Adam Tkac
Ben Levenson
:
: 150703 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-04 05:08 EST by Tim Waugh
Modified: 2013-04-30 19:33 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-30 05:57:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
sendmail.cf (56.69 KB, text/plain)
2005-03-04 05:08 EST, Tim Waugh
no flags Details

  None (edit)
Description Tim Waugh 2005-03-04 05:08:44 EST
Description of problem:
All outgoing mail gets stuck with this in maillog:

Mar  3 12:37:40 gene sendmail[5314]: j23Cbe8O005312: SYSERR(root): getmxrr:
res_search (pobox.surrey.redhat.com) failed with impossible h_errno (0)
Mar  3 12:37:40 gene sendmail[5314]: j23Cbe8O005312:
to=<laroche@redhat.com>,<notting@redhat.com>,<kreilly@redhat.com>,
ctladdr=<twaugh@gene.surrey.redhat.com>
(2472/2478), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=181707,
relay=pobox.surrey.redhat.com, dsn=4.0.0, stat=Operating system error

Version-Release number of selected component (if applicable):
sendmail-8.13.3-1.1

How reproducible:
100%

Steps to Reproduce:
1. See attached /etc/mail/sendmail.cf
  
Additional info:
Backing off to sendmail-8.13.3-1 fixes it for me.
Comment 1 Tim Waugh 2005-03-04 05:08:44 EST
Created attachment 111657 [details]
sendmail.cf
Comment 2 Tim Waugh 2005-03-07 10:33:44 EST
FWIW, changing 'DSpobox.surrey.redhat.com' to 'DS[pobox.surrey.redhat.com]' in
sendmail.cf made this work again, but I couldn't work out why res_search() was
returning -1 but leaving h_errno=0.
Comment 3 Jonathan Kamens 2005-03-08 20:28:25 EST
I think this is a bind problem, not a sendmail problem.  The following
program prints h_errno=4 correctly when linked against the libresolv
that comes with glibc but prints h_errno when linked against the
libbind that comes with bind-libs-9.3.1rc1-3.

#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <netdb.h>

main()
{
  int ret;
  unsigned char answer[256] = {0};

  res_init();
  ret = res_search("105-10.202-68.tampabay.res.rr.com.", ns_c_in, ns_t_mx,
		   answer, sizeof answer);
  printf("ret=%d, h_errno=%d, answer=%s\n", ret, h_errno, answer);
}
Comment 4 Jason Vas Dias 2005-03-09 22:27:20 EST
This problem is now fixed with bind-9.3.1rc1-5 .

Incorrect assumptions in the code about pthread
availability resulted in the wrong h_errno_location()
being used.   

Note that the res_search function is deprecated, and the proper
way to write the above code would be:

#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <netinet/in.h>
#include <bind/arpa/inet.h>
#include <bind/arpa/nameser.h>
#include <bind/resolv.h>
#include <bind/netdb.h>
#include <stdio.h>

static struct __res_state res;

main()
{
  int ret;
  unsigned char answer[256] = {0};


  memset(&res, '\0', sizeof(res));
  res_ninit(&res);
  ret = res_nsearch(&res,"105-10.202-68.tampabay.res.rr.com.",
ns_c_in, ns_t_mx,
		   answer, sizeof answer);
  printf("ret=%d, h_errno=%d\n", ret, h_errno);
  if ( ret > 0 )
      fp_nquery(answer,ret,stdout);
}

Comment 5 Bill Nottingham 2005-03-09 23:01:38 EST
*** Bug 150703 has been marked as a duplicate of this bug. ***
Comment 6 Adam Tkac 2007-05-30 05:57:59 EDT
Looks like fixed. If still exists, please reopen.

Regards, Adam
Comment 7 Adam Tkac 2007-07-02 11:06:41 EDT
Huh, after investigation about bug #245857 patch for this bug is completely wrong. 
About comment #3 :
libbind uses different resolving mechanisms so if you want use libbind resolver
you must bind/* headers instead glibc's headers (as Jason wrote in comment #4).
Also I believe when sendmail was linked against libbind it includes wrong
headers => NOTABUG

Adam
Comment 8 Adam Tkac 2007-08-30 10:48:23 EDT
This problem needs more investigation especially with recently upstream changes.
Patch's idea is completely unusable

2205.   [bug]           libbind: change #2119 broke thread support. [RT #16982]
2119.   [compat]        libbind: allow res_init() to succeed enough to
                        return the default domain even if it was unable
                        to allocate memory.

*** This bug has been marked as a duplicate of 254501 ***

Note You need to log in before you can comment on or make changes to this bug.