From: madcoder at gmail dot com
Operating system: 2.6.15-gentoo linux amd64
PHP version: 5.1.6
PHP Bug Type: LDAP related
Bug description: segfault in ldap_get_entries()
Description:
------------
I'm getting a segmentation fault when calling ldap_get_entries() after an
ldap search. I get no errors after any of the function calls prior to
ldap_get_entries() (as suggested by ldap_errno() == 0).
Running a similar ldapsearch command line query returns results as
expected.
A similar configuration on another linux installation of the same version
works with no problems. The major difference between those two servers is
the CPU (the working one is an Intel P4, the one that is segfaulting is an
AMD 64-bit Athlon XP)
Reproduce code:
---------------
<?php
$_SERVER['ldap'] = ldap_connect("ldap://server.domain");
ldap_set_option($_SERVER['ldap'], LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($_SERVER['ldap'], LDAP_OPT_REFERRALS, 0);
ldap_start_tls($_SERVER['ldap']);
ldap_bind($_SERVER['ldap'], 'user@domain', 'password');
$r = ldap_search($_SERVER['ldap'], 'dc=fq,dc=domain,dc=name',
'(sAMAccountName=someUser)');
echo "done searching\n";
$info = ldap_get_entries($_SERVER['ldap'], $r);
echo "done fetching\n";
?>
Expected result:
----------------
"done fetching\n" should be printed, and $info should contain an array of
entries returned from the LDAP server.
Actual result:
--------------
# php -e test.php
done searching
Segmentation fault (core dumped)
----------
# gdb php core
GNU gdb 6.4
(gdb) bt
#0 0x00002aaaac8cbf4b in ?? ()
#1 0xa6e95d9926b7ed00 in ?? ()
#2 0x0000555555dbe260 in ?? ()
#3 0x0000555555de16c0 in ?? ()
#4 0x00005555556a92b5 in ?? ()
#5 0x000000000000000f in ?? ()
#6 0x0000000000000001 in ?? ()
#7 0x000000000000000f in ?? ()
#8 0x00002aaaaea76cf0 in ?? ()
#9 0x0000000000000003 in ?? ()
#10 0x0000000000000000 in ?? ()
(I realize this backtrace is not helpful... I've tried re-emerging the
php ebuild several times with the debug USE flag enabled, and it seems all
the debug info is still being stripped from the binaries. I will try
compiling from source with the appropriate options and reply with a more
useful backtrace)
--
Edit bug report at http://bugs.php.net/?id=38819&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38819&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38819&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38819&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38819&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38819&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38819&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38819&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38819&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38819&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38819&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38819&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38819&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38819&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38819&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38819&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38819&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38819&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38819&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38819&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38819&r=mysqlcfg