This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nss/20612] New: getaddrinfo() returns EAI_SYSTEM depending on uninitialized value
- From: "vadmium+floss at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 15 Sep 2016 14:04:10 +0000
- Subject: [Bug nss/20612] New: getaddrinfo() returns EAI_SYSTEM depending on uninitialized value
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=20612
Bug ID: 20612
Summary: getaddrinfo() returns EAI_SYSTEM depending on
uninitialized value
Product: glibc
Version: 2.24
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: nss
Assignee: unassigned at sourceware dot org
Reporter: vadmium+floss at gmail dot com
Target Milestone: ---
Created attachment 9512
--> https://sourceware.org/bugzilla/attachment.cgi?id=9512&action=edit
Demo, compiled with c99 t.c
On x86-64 Arch Linux, I have /usr/lib/libnss_wins.so.2 installed from the
smbclient 4.5.0 package. I have enabled it by adding “wins” to the end of the
“hosts” line in /etc/nsswitch.conf:
hosts: files dns myhostname wins
Running the attached program can get getaddrinfo() to quickly return
EAI_SYSTEM, without actually setting errno. In other cases, getaddrinfo() has a
short delay before returning, and returns EAI_NONAME, which seems to be the
normal behaviour. I always seem to get the normal behaviour on a 32-bit x86
computer. I can also trigger the normal behaviour by changing the f(0xFF) call
to f(0x00), although valgrind still reports uninitialized value errors.
Eg of incorrect output:
$ c99 t.c
$ valgrind ./a.out
==13182== Memcheck, a memory error detector
==13182== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==13182== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==13182== Command: ./a.out
==13182==
==13182== Conditional jump or move depends on uninitialised value(s)
==13182== at 0x4F09FCD: gaih_inet.constprop.5 (in /usr/lib/libc-2.24.so)
==13182== by 0x4F0A177: getaddrinfo (in /usr/lib/libc-2.24.so)
==13182== by 0x4006FD: main (in /media/disk/home/proj/python/cpython/a.out)
==13182==
getaddrinfo() -> -11 System error (errno = 0 Success)
. . .
[Exit 1]
--
You are receiving this mail because:
You are on the CC list for the bug.