Bug 5012 - Second bug with gethostbyname (fails with Segmentation fault in special conditions)
Summary: Second bug with gethostbyname (fails with Segmentation fault in special condi...
Status: RESOLVED INVALID
Alias: None
Product: uClibc
Classification: Unclassified
Component: Networking (show other bugs)
Version: 0.9.32.1
Hardware: PC Linux
: P5 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 19:20 UTC by perfectflow
Modified: 2012-04-19 12:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
/etc/hosts file for uClibc test (152 bytes, application/octet-stream)
2012-04-02 19:20 UTC, perfectflow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description perfectflow 2012-04-02 19:20:15 UTC
Created attachment 4226 [details]
/etc/hosts file for uClibc test

I have found second bug in gethostbyname implementation...
and theese bugs are serious guys, I don't know why they are still in uClibc ...

Buildroot with uClibc 0.9.33, i386/i586, optimized by size, gcc 4.4.6

How to reproduce:

1) use /etc/hosts from attachment (what is special - it has no new line in last string)

2) compile and run this test:
--------------------------------------
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>

int main(void)
{
    int i;
    struct hostent *h;

    for(i=1;i<100;i++)
    {
        printf("i=%i\n",i);
        h = gethostbyname( "aaaaaaaaaaaaaaaaaaaaa.com");
    }    

}
--------------------------------------

3) Usually it fails with:

i=1
i=2
Segmentation fault
Comment 1 Bernhard Reutner-Fischer 2012-04-17 11:34:30 UTC
I cannot reproduce this.
First, try gcc-4.6 or later. If that does not help, try DODEBUG=y and let us know if you still experience the problem.
Comment 2 perfectflow 2012-04-19 12:43:00 UTC
Sorry, I mistaken, this bug was in dietlibc, not in uClibc. Ticket closed.