Bug 597578 - static binaries using gethostbyname segfault (nss_files)
Summary: static binaries using gethostbyname segfault (nss_files)
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 13
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Andreas Schwab
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 644673 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-29 17:08 UTC by Kris Rusocki
Modified: 2016-11-24 15:52 UTC (History)
4 users (show)

Fixed In Version: 2.12.90-3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-05 13:20:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Kris Rusocki 2010-05-29 17:08:51 UTC
Description of problem:
Per summary. I wouldn't be surprised if root cause
of this issue was outside glibc though. I thought
I'd report it before taking a closer look. Let know
if you need anything else. Thanks.

Version-Release number of selected component (if applicable):
2.12-1

How reproducible:
Always

Steps to Reproduce:
1. Build following code with gcc -static

#include <netdb.h>

int main(int ac, char **av)
{
	gethostbyname("fedoraproject.org");
	return 0;
}


2. Run resulting binary

  
Actual results:
Segfault.

Expected results:
No segfault (to begin with).

Additional info:
Loaded symbols for /lib64/ld-2.12.so
Core was generated by `./demo'.
Program terminated with signal 11, Segmentation fault.
#0  new_heap (size=<value optimized out>, top_pad=<value optimized out>)
    at arena.c:759
759	  h->size = size;
(gdb) bt
#0  new_heap (size=<value optimized out>, top_pad=<value optimized out>)
    at arena.c:759
#1  0x00000036bf477243 in _int_new_arena (a_tsd=<value optimized out>, 
    size=568) at arena.c:907
#2  arena_get2 (a_tsd=<value optimized out>, size=568) at arena.c:1054
#3  0x00000036bf479c17 in __libc_malloc (bytes=568) at malloc.c:3672
#4  0x00000036bf46690b in __fopen_internal (
    filename=0x7ffff7deb2a6 "/etc/hosts", mode=0x7ffff7deb286 "re", is32=1)
    at ../libio/iofopen.c:76
#5  0x00007ffff7de46e3 in internal_setent (stayopen=0)
    at nss_files/files-XXX.c:80
#6  0x00007ffff7de5e12 in _nss_files_gethostbyname_r (
    name=0x4828d0 "fedoraproject.org", result=0x6ad2c0, buffer=0x6b07e0 "", 
    buflen=1024, errnop=0x6af828, herrnop=0x7fffffffe22c)
    at nss_files/files-hosts.c:290
#7  0x000000000040e901 in gethostbyname_r ()
#8  0x000000000040e671 in gethostbyname ()
#9  0x000000000040042d in main ()
(gdb)

Comment 1 Andreas Schwab 2010-10-20 08:25:02 UTC
*** Bug 644673 has been marked as a duplicate of this bug. ***


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