<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8087</bug_id>
          
          <creation_ts>2015-08-02 02:32:41 +0000</creation_ts>
          <short_desc>Bug in resolv patch</short_desc>
          <delta_ts>2017-07-31 17:01:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Rogers">honey</reporter>
          <assigned_to name="Khem Raj">raj.khem</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>raj.khem</cc>
    
    <cc>rongqing.li</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>52762</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Rogers">honey</who>
    <bug_when>2015-08-02 02:32:41 +0000</bug_when>
    <thetext>The patch here: http://cgit.openembedded.org/openembedded/plain/recipes/glibc/files/glibc-2.5-local-dynamic-resolvconf.patch
contains the bug described here: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1432378

Perhaps worth looking into removing it in oe.


Thanks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53065</commentid>
    <comment_count>1</comment_count>
    <who name="LiRongQing">rongqing.li</who>
    <bug_when>2015-08-13 02:16:48 +0000</bug_when>
    <thetext>Joshua Rogers:

I see you suggest a fix for this patch, to replace __res_vinit() with res_query() , does it merged into ubuntu, or acceptable?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53067</commentid>
    <comment_count>2</comment_count>
      <attachid>2663</attachid>
    <who name="Joshua Rogers">honey</who>
    <bug_when>2015-08-13 04:32:01 +0000</bug_when>
    <thetext>Created attachment 2663
Bug fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53068</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Rogers">honey</who>
    <bug_when>2015-08-13 04:33:11 +0000</bug_when>
    <thetext>Hi,

My fixis to, inside the res_init() function, replace the call to __res_vinit with __res_maybe_init, while setting something that ensures that __res_maybe_init will always init.

As it is, res_init() is only called in two places within the eglibc code.

Once in a memory leak test, http://www.eglibc.org/cgi-bin/viewvc.cgi/trunk/libc/resolv/tst-leaks2.c?annotate=24942#l31

and in the local_hostname_function, http://www.eglibc.org/cgi-bin/viewvc.cgi/trunk/libc/resolv/res_data.c?annotate=23297#l311

Other than that, res_init is a dead function, other than at the user-level.
The manual says to use res_init(), and not __res_maybe_init()[which I assume wouldn&apos;t work at user-level anyways], making it a problem.

I also have just now noticed that the mtime is not set unless (resp-&gt;options &amp; RES_INIT) is true, so I&apos;ve added the appropriate code to res_libc.c too.

res_init() in res_data.c file is only used if _LIBC is not defined. But I added a fix for that too.

Funnily enough, in res_libc.c&apos;s res_init() function, it does this:
	atomicinclock (lock);
	/* Request all threads to re-initialize their resolver states,
	   resolv.conf might have changed.  */
	atomicinc (__res_initstamp);
	atomicincunlock (lock);

however that would only do something, if __res_maybe_init was called, and (resp-&gt;options &amp; RES_INIT) was true. So really, there&apos;s 2 bugs in 1.

Anyways, let me know what you think of the patch. If you think it is OK, I&apos;ll submit to to Ubuntu/Debian too. Noting however, that eglibc is EOL&apos;d, and Ubuntu has stopped using it in 15.04. It is still being used in 14.04.1 LTS, which is set to EOL April 2019. Likewise, Ubuntu 12.04.5 is set to EOL in April 2017, and it uses it too.

Thanks,



I&apos;ve attached my suggestion patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68417</commentid>
    <comment_count>4</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2016-11-17 17:11:31 +0000</bug_when>
    <thetext>Do you still see this bug with glibc 2.24 ? eglibc is dead now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68646</commentid>
    <comment_count>5</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2016-11-28 19:52:41 +0000</bug_when>
    <thetext>I think I am in favor of removing this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69936</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-01-19 15:54:42 +0000</bug_when>
    <thetext>Update: we still have this in glibc 2.5.  Khem, can you look at it again and either upstream or remove it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73328</commentid>
    <comment_count>7</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2017-05-18 15:16:58 +0000</bug_when>
    <thetext>See Ross&apos; question</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74336</commentid>
    <comment_count>8</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2017-06-19 17:14:46 +0000</bug_when>
    <thetext>so far it seems we still need it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74526</commentid>
    <comment_count>9</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2017-06-23 19:31:05 +0000</bug_when>
    <thetext>It appears the question has been answered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74795</commentid>
    <comment_count>10</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2017-07-06 05:15:42 +0000</bug_when>
    <thetext>upcoming glibc 2.26 has reworked resolv code a bit and specifically addressed this issue

https://sourceware.org/bugzilla/show_bug.cgi?id=984

which was long standing in glibc. We will have glibc 2.26 in 2.4 release.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75507</commentid>
    <comment_count>11</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2017-07-31 17:01:11 +0000</bug_when>
    <thetext>glibc 2.26 rc has landed in master</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2663</attachid>
            <date>2015-08-13 04:32:01 +0000</date>
            <delta_ts>2015-08-13 04:32:01 +0000</delta_ts>
            <desc>Bug fix</desc>
            <filename>res.patch</filename>
            <type>text/plain</type>
            <size>2517</size>
            <attacher name="Joshua Rogers">honey</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL3Jlc29sdi9yZXNfZGF0YS5jIGIvcmVzb2x2L3Jlc19kYXRhLmMKaW5kZXgg
ODFjOWFlNS4uZjU1Y2FkNCAxMDA2NDQKLS0tIGEvcmVzb2x2L3Jlc19kYXRhLmMKKysrIGIvcmVz
b2x2L3Jlc19kYXRhLmMKQEAgLTEyNiw3ICsxMjYsMzIgQEAgcmVzX2luaXQodm9pZCkgewogCWlm
ICghX3Jlcy5pZCkKIAkJX3Jlcy5pZCA9IHJlc19yYW5kb21pZCgpOwogCi0JcmV0dXJuIChfX3Jl
c192aW5pdCgmX3JlcywgMSkpOworCS8qCisJICogU2luY2UgX19yZXNfbWF5YmVfaW5pdCgpIGlz
IHVzZWQgZm9yIGludGVybmFsIGdsaWJjIGZ1bmN0aW9ucywgYW5kCisJICogd2lsbCBjYWxsIF9f
cmVzX3Zpbml0KCkgaWYgdGhlIGxhc3QgbW9kaWZpY2F0aW9uIGRhdGUgb2Ygb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