ID: 38819 Updated by: [EMAIL PROTECTED] Reported By: madcoder at gmail dot com -Status: Open +Status: Feedback Bug Type: LDAP related Operating System: 2.6.15-gentoo linux amd64 PHP Version: 5.1.6 New Comment:
Is it possible to perform the same actions using ldapsearch utility in console? Previous Comments: ------------------------------------------------------------------------ [2006-09-26 10:43:23] madcoder at gmail dot com Program received signal SIGSEGV, Segmentation fault. 0x00002af2b2e5f0ab in ldap_count_values (vals=0x55a07f90) at getvalues.c:153 153 for ( i = 0; vals[i] != NULL; i++ ) (gdb) p vals $1 = (char **) 0x55a07f90 (gdb) p 0 $2 = 0 (gdb) p vals[0] Cannot access memory at address 0x55a07f90 The memory address is the same. Can't access memory? It seems like its a problem in php's ldap_get_entries still (or further up the stack) because ldap_count_entries(), which calls the same function, works fine and returns '1'. ------------------------------------------------------------------------ [2006-09-26 10:38:38] [EMAIL PROTECTED] And what is in vals[0] ? (gdb) p vals[0] ------------------------------------------------------------------------ [2006-09-26 10:28:55] madcoder at gmail dot com I do still get the segfault. This is the output from gdb: (gdb) set args -e test.php (gdb) run Starting program: /root/php-5.1.6/sapi/cli/php -e test.php done searching Count: 1 entries Program received signal SIGSEGV, Segmentation fault. 0x00002b92baa9a0ab in ldap_count_values (vals=0x55a07f90) at getvalues.c:153 153 for ( i = 0; vals[i] != NULL; i++ ) (gdb) f 0 #0 0x00002b92baa9a0ab in ldap_count_values (vals=0x55a07f90) at getvalues.c:153 153 for ( i = 0; vals[i] != NULL; i++ ) (gdb) p vals $1 = (char **) 0x55a07f90 (gdb) p i $2 = 0 If I'm understanding that correctly, it means the segfault is occuring on the first iteration of the ldap_count_values() for loop. The first thing I notice is that 'vals' is a 32-bit pointer. Would that have any effect on the problem, considering this is a 64-bit system? Should I have 32-bit emulation libraries installed for this? The only reason I haven't installed the libraries so far is because none of the other packages I've installed have specifically said that they are necessary. ------------------------------------------------------------------------ [2006-09-26 10:08:02] [EMAIL PROTECTED] Ok, then please do the following: 1) get OpenLDAP sources from openldap.org (2.3.27 is the current stable version) 2) get PHP 5.1.6 sources from php.net 3) build openldap from the sources with --enable-debug and --prefix=/tmp/openldap 4) build PHP with ./configure --enable-debug --disable-all --with-ldap=/tmp/openldap (no need to run make install, just use CLI binary - ./sapi/cli/php). 5) try to reproduce it again and when/if it segfaults again type the following commands in gdb console: (gdb) f 0 (gdb) p vals (gdb) p i I'd also appreciate if you run it through valgrind and see if there are any errors reported. ------------------------------------------------------------------------ [2006-09-26 09:48:51] madcoder at gmail dot com No, I'm sorry, it's on a private LAN. A VPN account would be required to gain access to the LAN, and corporate policy won't allow me to grant you that. If you would like to contact me off-bugzilla, I might be able to arrange a different way of accessing the server. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/38819 -- Edit this bug report at http://bugs.php.net/?id=38819&edit=1