#34926 [Opn->Fbk]: gethostbyname gives segmentation fault in cli
ID: 34926
Updated by: tony2001@php.net
Reported By: php at m0z dot net
-Status: Open
+Status: Feedback
Bug Type: Network related
Operating System: FreeBSD 5.x
PHP Version: 5.0.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Works perfectly here.
Previous Comments:
------------------------------------------------------------------------
[2005-10-20 10:39:21] php at m0z dot net
Description:
------------
PHP segfaults when trying to resolve a hostname internally. We
encountered this with mysql_connect, gethostbyname, socket_connect in:
- PHP 5.0.5 (cgi-fcgi AND cli)
- PHP 4.4.0
All when run from shell.
Reproduce code:
---------------
<?php
echo gethostbyname("www.google.com");
?>
Expected result:
----------------
64.233.183.99
Actual result:
--------------
Segmentation fault (core dumped)
gdb backtrace:
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x2955a5b9 in ?? () from /usr/local/lib/nss_ldap.so.1
#2 0x29565f40 in ?? () from /usr/local/lib/nss_ldap.so.1
#3 0x2819c760 in ?? () from /libexec/ld-elf.so.1
#4 0x2819c5d8 in ?? () from /libexec/ld-elf.so.1
#5 0x2955a554 in ?? () from /usr/local/lib/nss_ldap.so.1
#6 0x28181730 in _rtld_error () from /libexec/ld-elf.so.1
#7 0x29563d8d in _fini () from /usr/local/lib/nss_ldap.so.1
#8 0x2818280b in find_symdef () from /libexec/ld-elf.so.1
#9 0x28182e6a in dlclose () from /libexec/ld-elf.so.1
#10 0x2848953c in _nsdbtput () from /lib/libc.so.5
#11 0x28488ef0 in endhostent () from /lib/libc.so.5
#12 0x284895bb in _nsdbtput () from /lib/libc.so.5
#13 0x284ac1a5 in __cxa_finalize () from /lib/libc.so.5
#14 0x284abec6 in exit () from /lib/libc.so.5
#15 0x0815017b in main ()
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34926&edit=1
Thread (2 messages)