<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>11201</bug_id>
          
          <creation_ts>2007-03-23 19:29:11 +0300</creation_ts>
          <short_desc>Segmentation fault when use getifaddrs function</short_desc>
          <delta_ts>2007-09-19 04:55:55 +0400</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>glibc</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc>http://www.mail-archive.com/debian-glibc@lists.debian.org/msg32785.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Klimov Denis">kliden</reporter>
          <assigned_to name="Gleb F-Malinovskiy">glebfm</assigned_to>
          <cc>glebfm</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>vvk</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>47097</commentid>
    <comment_count>0</comment_count>
    <who name="Klimov Denis">kliden</who>
    <bug_when>2007-03-23 19:29:15 +0300</bug_when>
    <thetext>This is my program, which demo bug in getifaddrs function:

/* TEST BUG PROGRAM
 *
 * Compile
 * gcc -o getifaddrs getifaddrs.c
 *
 * Testing
 * with up and down ppp* interfaces run ./getifaddrs
 *
 * Author: Klimov Denis aka zver
 * email: kliden &lt;at&gt; km.ru
 * 23/03/2007
 *
 * P.S. some problem info about this bug you may read
 * http://www.mail-archive.com/debian-glibc@lists.debian.org/msg32785.html
 */

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
#include &lt;ifaddrs.h&gt;

int main()
{
struct ifaddrs *ifap = NULL;
int rez = getifaddrs(&amp;ifap);
int st=1;
if (rez==0 &amp;&amp; ifap!=NULL)
        {
        do
                {
                if (st==1)
                        st=0;
                        else
                        ifap=(*ifap).ifa_next;
                if (ifap-&gt;ifa_addr-&gt;sa_family == AF_INET)
                        {
                        printf(&quot;Interface name: %s \n&quot;,(*ifap).ifa_name);
                        }
                }
        while  ((*ifap).ifa_next!=NULL);
        }
return 0;
}

Actual Results:  
Segmentation fault when ppp* device up
List network device when _all_ ppp* device down

Expected Results:  
List network device always

some problem info about this bug you may read example at this page:
http://www.mail-archive.com/debian-glibc@lists.debian.org/msg32785.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47098</commentid>
    <comment_count>1</comment_count>
      <attachid>1872</attachid>
    <who name="Klimov Denis">kliden</who>
    <bug_when>2007-03-23 19:32:23 +0300</bug_when>
    <thetext>Created attachment 1872
prog for test bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47283</commentid>
    <comment_count>2</comment_count>
    <who name="Klimov Denis">kliden</who>
    <bug_when>2007-03-27 15:45:17 +0400</bug_when>
    <thetext>May be this help:
http://sources.redhat.com/ml/ecos-patches/2004-06/msg00015.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55468</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2007-09-19 04:55:55 +0400</bug_when>
    <thetext>ifa_addr references either the address of the interface or the link level
address of the interface, if one exists, otherwise it is NULL.

That is, your test case is bogus.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1872</attachid>
            <date>2007-03-23 19:32:23 +0300</date>
            <delta_ts>2007-03-23 19:32:23 +0300</delta_ts>
            <desc>prog for test bug</desc>
            <filename>getifaddrs.c</filename>
            <type>text/plain</type>
            <size>826</size>
            <attacher name="Klimov Denis">kliden</attacher>
            
              <data encoding="base64">LyogVEVTVCBCVUcgUFJPR1JBTQogKgogKiBDb21waWxlIAogKiBnY2MgLW8gZ2V0aWZhZGRycyBn
ZXRpZmFkZHJzLmMKICoKICogVGVzdGluZwogKiB3aXRoIHVwIGFuZCBkb3duIHBwcCogaW50ZXJm
YWNlcyBydW4gLi9nZXRpZmFkZHJzCiAqIAogKiBBdXRob3I6IEtsaW1vdiBEZW5pcyBha2EgenZl
ciAKICogZW1haWw6IGtsaWRlbiA8YXQ+IGttLnJ1CiAqIDIzLzAzLzIwMDcgCiAqCiAqIFAuUy4g
c29tZSBwcm9ibGVtIGluZm8gYWJvdXQgdGhpcyBidWcgeW91IG1heSByZWFkIAogKiBodHRwOi8v
d3d3Lm1haWwtYXJjaGl2ZS5jb20vZGViaWFuLWdsaWJjQGxpc3RzLmRlYmlhbi5vcmcvbXNnMzI3
ODUuaHRtbAogKi8KCiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8c3RkbGliLmg+CgojaW5j
bHVkZSA8c3lzL3R5cGVzLmg+CiNpbmNsdWRlIDxzeXMvc29ja2V0Lmg+CiNpbmNsdWRlIDxpZmFk
ZHJzLmg+CgppbnQgbWFpbigpCnsKc3RydWN0IGlmYWRkcnMgKmlmYXAgPSBOVUxMOwppbnQgcmV6
ID0gZ2V0aWZhZGRycygmaWZhcCk7CmludCBzdD0xOwppZiAocmV6PT0wICYmIGlmYXAhPU5VTEwp
Cgl7CglkbwoJCXsKCQlpZiAoc3Q9PTEpCgkJCXN0PTA7CgkJCWVsc2UKCQkJaWZhcD0oKmlmYXAp
LmlmYV9uZXh0OwoJCWlmIChpZmFwLT5pZmFfYWRkci0+c2FfZmFtaWx5ID09IEFGX0lORVQpCiAg
ICAgICAgICAgICAgICAJewoJCQlwcmludGYoIkludGVyZmFjZSBuYW1lOiAlcyBcbiIsKCppZmFw
KS5pZmFfbmFtZSk7CgkJCX0KICAgICAgICAgICAgICAgIH0KCXdoaWxlICAoKCppZmFwKS5pZmFf
bmV4dCE9TlVMTCk7Cgl9CnJldHVybiAwOwp9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>