getaddrinfo() segfaults when linked statically
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Hi
While building qemu statically, I get a SEGV on startup when it calls getaddrinfo() for the VNC listener; it turns out this is easily reproducible with a small C test case when building statically.
gcc -O0 -o foo foo.c && ./foo
=> works
gcc -static -O0 -o foo foo.c && ./foo
=> segvs
(gdb) run
Starting program: /home/lool/foo
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ac79e3 in arena_get2 (a_tsd=
at arena.c:1072
1072 arena.c: Aucun fichier ou dossier de ce type.
in arena.c
(gdb) bt
#0 0x00007ffff7ac79e3 in arena_get2 (a_tsd=
at arena.c:1072
#1 0x00007ffff7acb53f in __libc_malloc (bytes=100) at malloc.c:3672
#2 0x00007ffff7abb1c9 in _IO_vasprintf (result_
format=0x64 <Address 0x64 out of bounds>, args=0x0) at vasprintf.c:52
#3 0x00007ffff7a9f8b8 in ___asprintf (string_ptr=0x0,
format=0x64 <Address 0x64 out of bounds>) at asprintf.c:37
#4 0x00007ffff7a7ba33 in __assert_fail (
assertion=
file=<value optimised out>, line=32,
function=
#5 0x00007ffff7b2e0c8 in __getpagesize ()
at ../sysdeps/
#6 0x00007ffff7ac6d72 in ptmalloc_
#7 ptmalloc_init () at arena.c:485
#8 0x00007ffff7acb5d7 in malloc_hook_ini (sz=0, caller=0x64) at hooks.c:37
#9 0x00007ffff7ab73ab in __fopen_internal (
filename=
mode=0x64 <Address 0x64 out of bounds>, is32=0)
at ../sysdeps/
#10 0x00007ffff7dd71e3 in internal_setent (stayopen=0)
at nss_files/
#11 0x00007ffff7dd7a1c in _nss_files_
name=<value optimised out>, pat=0x64, buffer=
buflen=1024, errnop=0x1, herrnop=0x0, ttlp=0x0)
at nss_files/
#12 0x000000000040e3d6 in gaih_inet ()
#13 0x0000000000410062 in getaddrinfo ()
#14 0x00000000004004a5 in main ()
Cheers,
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: libc6 2.12.1-0ubuntu6
ProcVersionSign
Uname: Linux 2.6.35-20-generic x86_64
Architecture: amd64
Date: Sat Sep 25 16:25:19 2010
ProcEnviron:
LANGUAGE=
PATH=(custom, user)
LANG=fr_FR.UTF-8
SHELL=/bin/zsh
SourcePackage: eglibc
I believe that Gentoo already has a fix for this. I'm going to attempt to use their patch to verify
Gentoo problem report: http:// bugs.gentoo. org/332927