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:

Doesn't look like PHP problem to me.
Could you plz also see if `valgrind /usr/bin/php test.php` show you
something interesting? Please put valgrind's log somewhere and paste
the URL here.


Previous Comments:
------------------------------------------------------------------------

[2006-09-18 23:38:16] madcoder at gmail dot com

Sorry for the delay (I had to fix an error with gdb not generating
backtraces on AMD64...)  Here's the backtrace:

-----
(gdb) run
Starting program: /usr/bin/php -e test.php
[Thread debugging using libthread_db enabled]
[New Thread 47773184727840 (LWP 28424)]
done searching

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47773184727840 (LWP 28424)]
0x00002b730d78de44 in ldap_count_values (vals=0x55e99220) at
getvalues.c:153
153     getvalues.c: No such file or directory.
        in getvalues.c
-----
(gdb) bt
#0  0x00002b730d78de44 in ldap_count_values (vals=0x55e99220) at
getvalues.c:153
#1  0x00005555556a25c0 in zif_ldap_get_entries (ht=1441370656,
return_value=0x555555e987a8, return_value_ptr=0x0,
    this_ptr=0x0, return_value_used=1438266616,
tsrm_ls=0x555555e9cc60)
    at
/var/tmp/portage/php-5.1.6-r4/work/php-5.1.6/ext/ldap/ldap.c:1068
#2  0x0000555555890d35 in zend_do_fcall_common_helper_SPEC
(execute_data=0x7fff9f13efb0, tsrm_ls=0x555555ba4450)
    at zend_vm_execute.h:200
#3  0x0000555555899c6a in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0x7fff9f13efb0, tsrm_ls=0x555555ba4450)
    at zend_vm_execute.h:1640
#4  0x000055555589039b in execute (op_array=0x555555e96ad8,
tsrm_ls=0x555555ba4450) at zend_vm_execute.h:92
#5  0x0000555555868a42 in zend_execute_scripts (type=8,
tsrm_ls=0x555555ba4450, retval=0x0, file_count=3)
    at /var/tmp/portage/php-5.1.6-r4/work/php-5.1.6/Zend/zend.c:1109
#6  0x000055555580f825 in php_execute_script
(primary_file=0x7fff9f1415d0, tsrm_ls=0x555555ba4450)
    at /var/tmp/portage/php-5.1.6-r4/work/php-5.1.6/main/main.c:1737
#7  0x0000555555939484 in main (argc=3, argv=0x7fff9f141888)
    at
/var/tmp/portage/php-5.1.6-r4/work/php-5.1.6/sapi/cli/php_cli.c:1093
-----

Let me know if you need anything else.

------------------------------------------------------------------------

[2006-09-14 08:28:40] [EMAIL PROTECTED]

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.



------------------------------------------------------------------------

[2006-09-14 01:29:55] madcoder at gmail dot com

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'], '[EMAIL PROTECTED]', '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 this bug report at http://bugs.php.net/?id=38819&edit=1

Reply via email to