Bug 150288 - Outgoing mail stuck with "impossible h_errno(0)"
Summary: Outgoing mail stuck with "impossible h_errno(0)"
Status: CLOSED DUPLICATE of bug 254501
Alias: None
Product: Fedora
Classification: Fedora
Component: bind (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: i386 Linux
Target Milestone: ---
Assignee: Adam Tkac
QA Contact: Ben Levenson
: 150703 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2005-03-04 10:08 UTC by Tim Waugh
Modified: 2013-04-30 23:33 UTC (History)
4 users (show)

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

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

Description Tim Waugh 2005-03-04 10:08:44 UTC
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:
(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):

How reproducible:

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 10:08:44 UTC
Created attachment 111657 [details]

Comment 2 Tim Waugh 2005-03-07 15:33:44 UTC
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-09 01:28:25 UTC
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>

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

  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-10 03:27:20 UTC
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;

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

  memset(&res, '\0', sizeof(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 )

Comment 5 Bill Nottingham 2005-03-10 04:01:38 UTC
*** Bug 150703 has been marked as a duplicate of this bug. ***

Comment 6 Adam Tkac 2007-05-30 09:57:59 UTC
Looks like fixed. If still exists, please reopen.

Regards, Adam

Comment 7 Adam Tkac 2007-07-02 15:06:41 UTC
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


Comment 8 Adam Tkac 2007-08-30 14:48:23 UTC
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.