#36206 [Opn->Fbk]: LDAP in nsswitch.conf causes segfault when resolving hostnames in PHP

From: Date: Mon, 30 Jan 2006 10:55:19 +0000
Subject: #36206 [Opn->Fbk]: LDAP in nsswitch.conf causes segfault when resolving hostnames in PHP
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92628@lists.php.net to get a copy of this message
ID: 36206 Updated by: tony2001@php.net Reported By: arnout at argeweb dot nl -Status: Open +Status: Feedback Bug Type: CGI related Operating System: freeBSD 5.4 PHP Version: 5.1.2 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-01-30 11:41:10] arnout at argeweb dot nl Description: ------------ Any hostname resolve in PHP causes a segmentation fault. It only happens when this file contains the ldap keyword. When removed, everything works fine. Everything works great when using modphp. It only happens when using the executable. root@host: / # cat /etc/nsswitch.conf group: files ldap group_compat: nis hosts: files dns networks: files passwd: files passwd_compat: nis shells: files We've seen it on two seperate systems. It's on PHP versions 5.0.5, 5.1.1 and 5.1.2 Server #1: openldap 2.2.30 nss_ldap 1.244 php 5.0.5 FreeBSD 5.4-RELEASE-p8 Server #2: nss_ldap-1.239 openldap-client-2.2.27 php 5.1.2 FreeBSD 5.4-RELEASE-p8 Reproduce code: --------------- root@host: / # echo "<? echo gethostbyname('php.net'); ?>" | php root@host: / # echo "<? mysql_connect( 'badgerbadger', '', '' ); ?>" | php #!/usr/local/bin/php <?php // this echo gethostbyname( 'php.net' ); // AND this too mysql_connect( 'blahdieblah', '', '' ); // and anything that resolves. ?> Expected result: ---------------- An IP-address and an error because the mysql host doesn't exist. Actual result: -------------- Segmentation fault on any line that resolves a hostname. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36206&edit=1

« previous php.bugs (#92628) next »