This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/21975] New: gethostbyname always segfaults if linked statically
- From: "horst at schirmeier dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 18 Aug 2017 19:18:14 +0000
- Subject: [Bug network/21975] New: gethostbyname always segfaults if linked statically
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21975
Bug ID: 21975
Summary: gethostbyname always segfaults if linked statically
Product: glibc
Version: 2.24
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: network
Assignee: unassigned at sourceware dot org
Reporter: horst at schirmeier dot com
Target Milestone: ---
With glibc 2.24 (reproducible on 64-bit Debian 9 or Ubuntu 17.04),
gethostbyname() always segfaults if the binary was linked statically:
$ echo -e "#include <netdb.h>\nint main(void){gethostbyname(\"foo\");}" > foo.c
&& gcc -g -static foo.c && ./a.out
/tmp/ccp8JNGC.o: In function `main':
/tmp/foo.c:2: warning: Using 'gethostbyname' in statically linked applications
requires at runtime the shared libraries from the glibc version used for
linking
Segmentation fault (core dumped)
$ gdb -c core
GNU gdb (Ubuntu 7.12.50.20170314-0ubuntu1.1) 7.12.50.20170314-git
[...]
[New LWP 28640]
Core was generated by `./a.out'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007f8d940bbf90 in ?? ()
#2 0x00007fff8e02d0a0 in ?? ()
#3 0x0000000000000010 in ?? ()
#4 0x0000000000800000 in ?? ()
#5 0xffffffffffffffff in ?? ()
#6 0x00007f8d940bbbd0 in ?? ()
#7 0x0000000180000000 in ?? ()
#8 0x0000000000000000 in ?? ()
Unlike bug 10652, -lpthread is not needed to reproduce this issue.
--
You are receiving this mail because:
You are on the CC list for the bug.