Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 597578 - static binaries using gethostbyname segfault (nss_files)
static binaries using gethostbyname segfault (nss_files)
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
13
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Andreas Schwab
Fedora Extras Quality Assurance
:
: 644673 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-29 13:08 EDT by Kris Rusocki
Modified: 2016-11-24 10:52 EST (History)
4 users (show)

See Also:
Fixed In Version: 2.12.90-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-05 09:20:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kris Rusocki 2010-05-29 13:08:51 EDT
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 04:25:02 EDT
*** 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.