php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34926 gethostbyname gives segmentation fault in cli
Submitted: 2005-10-20 10:39 UTC Modified: 2005-10-28 01:00 UTC
From: php at m0z dot net Assigned:
Status: No Feedback Package: Network related
PHP Version: 5.0.5 OS: FreeBSD 5.x
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at m0z dot net
New email:
PHP Version: OS:

 

 [2005-10-20 10:39 UTC] 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 ()


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-20 11:17 UTC] tony2001@php.net
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.
 [2005-10-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 03:01:28 2024 UTC