#38819 [NEW]: segfault in ldap_get_entries()

Ask a Question related to PHP Bugs, Design and Development.

  1. #21

    Default #38819 [Opn->Fbk]: segfault in ldap_get_entries()

    ID: 38819
    Updated by: [email]tony2001@php.net[/email]
    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:

    And what is in vals[0] ?
    (gdb) p vals[0]


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

    [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]tony2001@php.net[/email]

    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.

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

    [2006-09-26 09:38:39] [email]tony2001@php.net[/email]

    Is it possible to get an account @ this server?

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

    [2006-09-26 09:36:37] madcoder at gmail dot com

    Sorry for the extra post... I just tested with different values in
    ldap_connect. For all values of the hostname parameter that I tried,
    any that were *NOT* prefixed with "ldap://" caused a segmentation fault
    at line 2:
    ldap_set_option($_SERVER['ldap'], LDAP_OPT_PROTOCOL_VERSION, 3);

    The various values I tried, all of which resulted in a segfault, were:
    hostname (xyzdc01 and xyzdc02)
    IP (172.16.0.50 and 172.16.0.51)
    FQHN (xyzdc01.xyz.acs-inc.com and xyzdc02.xyz.acs-inc.com)

    All of the above, when prefixed with ldap://, resulted in the same
    segfault described initially, at ldap_get_entries().

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    tony2001@php.net Guest

  2. Similar Questions and Discussions

    1. #40671 [NEW]: segfault in ldap_get_entries() & LDAP functions implemented poorly
      From: cardoe at gentoo dot org Operating system: Linux PHP version: 5.2.1 PHP Bug Type: LDAP related Bug description: ...
    2. #40026 [NEW]: ldap_get_entries dies with no errors
      From: sharul at utm dot my Operating system: Debian Sarge PHP version: 5.2.0 PHP Bug Type: LDAP related Bug description: ...
    3. GC Segfault [LONG]
      Hello Rubyists! let me apologize first: I have no means of condensing my problem to a few lines of code. I'll explain: I'm currently building...
    4. [PHP-DEV] Yet Another Segfault
      I came across the following segfault while working on PHPUnit. So far I have not been able to come up with a minimal reproducing script, but maybe...
    5. Segfault on 4.1.2 on RH 7.2
      Yes, yes, I know it's ancient -- but it's also what's out there for RPMs, and if I need to go to source I will, but for now... One single...
  3. #22

    Default #38819 [Fbk->Opn]: segfault in ldap_get_entries()

    ID: 38819
    User updated by: madcoder at gmail dot com
    Reported By: madcoder at gmail dot com
    -Status: Feedback
    +Status: Open
    Bug Type: LDAP related
    Operating System: 2.6.15-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    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'.


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

    [2006-09-26 10:38:38] [email]tony2001@php.net[/email]

    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]tony2001@php.net[/email]

    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.

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

    [2006-09-26 09:38:39] [email]tony2001@php.net[/email]

    Is it possible to get an account @ this 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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    madcoder at gmail dot com Guest

  4. #23

    Default #38819 [Opn->Fbk]: segfault in ldap_get_entries()

    ID: 38819
    Updated by: [email]tony2001@php.net[/email]
    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]tony2001@php.net[/email]

    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]tony2001@php.net[/email]

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    tony2001@php.net Guest

  5. #24

    Default #38819 [Fbk->Opn]: segfault in ldap_get_entries()

    ID: 38819
    User updated by: madcoder at gmail dot com
    Reported By: madcoder at gmail dot com
    -Status: Feedback
    +Status: Open
    Bug Type: LDAP related
    Operating System: 2.6.15-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    I've tried, but the program doesn't segfault, so it exits normally.
    I'm not very experienced with gdb, so I'm not sure how to give it a
    breakpoint of ldap_count_values (I tried 'break ldap_count_values' and
    'break ldap_count_values()', and it doesn't break).

    It does still return the information as expected.


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

    [2006-09-26 10:57:53] [email]tony2001@php.net[/email]

    Is it possible to perform the same actions using ldapsearch utility in
    console?

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

    [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]tony2001@php.net[/email]

    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]tony2001@php.net[/email]

    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.

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    madcoder at gmail dot com Guest

  6. #25

    Default #38819 [Opn]: segfault in ldap_get_entries()

    ID: 38819
    User updated by: madcoder at gmail dot com
    Reported By: madcoder at gmail dot com
    Status: Open
    Bug Type: LDAP related
    Operating System: 2.6.15-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    Any other ideas? This problem is kind of a blocker for me right now...
    I still don't understand why it works fine inside valgrind, but it
    segfaults on its own and inside gdb. I know it's segfaulting because
    of the message "Cannot access memory at address 0x55a0bfe0", so the for
    loop checking vals[i] obviously fails. But what steps can I take to
    debug this further?

    It could be a problem in openldap, since the line in php's ldap.c just
    before it calls the openldap function 'ldap_count_values' is
    ldap_get_values(), which is what is returning the memory address of
    0x55a0bfe0. But if it were in fact a problem with openldap, would the
    cli ldapsearch fail as well?


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

    [2006-09-26 11:08:50] madcoder at gmail dot com

    I've tried, but the program doesn't segfault, so it exits normally.
    I'm not very experienced with gdb, so I'm not sure how to give it a
    breakpoint of ldap_count_values (I tried 'break ldap_count_values' and
    'break ldap_count_values()', and it doesn't break).

    It does still return the information as expected.

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

    [2006-09-26 10:57:53] [email]tony2001@php.net[/email]

    Is it possible to perform the same actions using ldapsearch utility in
    console?

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

    [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]tony2001@php.net[/email]

    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.

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    madcoder at gmail dot com Guest

  7. #26

    Default #38819 [Opn]: segfault in ldap_get_entries()

    ID: 38819
    User updated by: madcoder at gmail dot com
    Reported By: madcoder at gmail dot com
    Status: Open
    Bug Type: LDAP related
    -Operating System: 2.6.15-gentoo linux amd64
    +Operating System: 2.6.17-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    For reference, I'm cross-posting a bug report I've opened with OpenLDAP
    (ITS# 4690) in case they can provide any further information:
    [url]http://www.openldap.org/its/index.cgi/Incoming?id=4690;expression=ldap_get_values;statet ype=-1[/url]


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

    [2006-09-30 03:37:13] madcoder at gmail dot com

    Any other ideas? This problem is kind of a blocker for me right now...
    I still don't understand why it works fine inside valgrind, but it
    segfaults on its own and inside gdb. I know it's segfaulting because
    of the message "Cannot access memory at address 0x55a0bfe0", so the for
    loop checking vals[i] obviously fails. But what steps can I take to
    debug this further?

    It could be a problem in openldap, since the line in php's ldap.c just
    before it calls the openldap function 'ldap_count_values' is
    ldap_get_values(), which is what is returning the memory address of
    0x55a0bfe0. But if it were in fact a problem with openldap, would the
    cli ldapsearch fail as well?

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

    [2006-09-26 11:08:50] madcoder at gmail dot com

    I've tried, but the program doesn't segfault, so it exits normally.
    I'm not very experienced with gdb, so I'm not sure how to give it a
    breakpoint of ldap_count_values (I tried 'break ldap_count_values' and
    'break ldap_count_values()', and it doesn't break).

    It does still return the information as expected.

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

    [2006-09-26 10:57:53] [email]tony2001@php.net[/email]

    Is it possible to perform the same actions using ldapsearch utility in
    console?

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

    [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]tony2001@php.net[/email]

    And what is in vals[0] ?
    (gdb) p vals[0]

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    madcoder at gmail dot com Guest

  8. #27

    Default #38819 [Opn->Fbk]: segfault in ldap_get_entries()

    ID: 38819
    Updated by: [email]tony2001@php.net[/email]
    Reported By: madcoder at gmail dot com
    -Status: Open
    +Status: Feedback
    Bug Type: LDAP related
    Operating System: 2.6.17-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    So does it work for you if you add that magical -DLDAP_DEPRECATED=1 ?


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

    [2006-10-01 08:16:08] madcoder at gmail dot com

    For reference, I'm cross-posting a bug report I've opened with OpenLDAP
    (ITS# 4690) in case they can provide any further information:
    [url]http://www.openldap.org/its/index.cgi/Incoming?id=4690;expression=ldap_get_values;statet ype=-1[/url]

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

    [2006-09-30 03:37:13] madcoder at gmail dot com

    Any other ideas? This problem is kind of a blocker for me right now...
    I still don't understand why it works fine inside valgrind, but it
    segfaults on its own and inside gdb. I know it's segfaulting because
    of the message "Cannot access memory at address 0x55a0bfe0", so the for
    loop checking vals[i] obviously fails. But what steps can I take to
    debug this further?

    It could be a problem in openldap, since the line in php's ldap.c just
    before it calls the openldap function 'ldap_count_values' is
    ldap_get_values(), which is what is returning the memory address of
    0x55a0bfe0. But if it were in fact a problem with openldap, would the
    cli ldapsearch fail as well?

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

    [2006-09-26 11:08:50] madcoder at gmail dot com

    I've tried, but the program doesn't segfault, so it exits normally.
    I'm not very experienced with gdb, so I'm not sure how to give it a
    breakpoint of ldap_count_values (I tried 'break ldap_count_values' and
    'break ldap_count_values()', and it doesn't break).

    It does still return the information as expected.

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

    [2006-09-26 10:57:53] [email]tony2001@php.net[/email]

    Is it possible to perform the same actions using ldapsearch utility in
    console?

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

    [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'.

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    tony2001@php.net Guest

  9. #28

    Default #38819 [Fbk->Opn]: segfault in ldap_get_entries()

    ID: 38819
    User updated by: madcoder at gmail dot com
    Reported By: madcoder at gmail dot com
    -Status: Feedback
    +Status: Open
    Bug Type: LDAP related
    Operating System: 2.6.17-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    In ext/ldap/config.m4, I changed the following to add the flag you
    mentioned:
    > CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"
    Then reconfigured and rebuilt php. I'm not sure if I did that
    properly, but from what information I found about the flag, that is
    appropriate.

    And I *do* still get the segfault. Should I try a distclean as well?
    Or should I recompile OpenLDAP first (with or without that flag)?


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

    [2006-10-02 09:20:13] [email]tony2001@php.net[/email]

    So does it work for you if you add that magical -DLDAP_DEPRECATED=1 ?

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

    [2006-10-01 08:16:08] madcoder at gmail dot com

    For reference, I'm cross-posting a bug report I've opened with OpenLDAP
    (ITS# 4690) in case they can provide any further information:
    [url]http://www.openldap.org/its/index.cgi/Incoming?id=4690;expression=ldap_get_values;statet ype=-1[/url]

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

    [2006-09-30 03:37:13] madcoder at gmail dot com

    Any other ideas? This problem is kind of a blocker for me right now...
    I still don't understand why it works fine inside valgrind, but it
    segfaults on its own and inside gdb. I know it's segfaulting because
    of the message "Cannot access memory at address 0x55a0bfe0", so the for
    loop checking vals[i] obviously fails. But what steps can I take to
    debug this further?

    It could be a problem in openldap, since the line in php's ldap.c just
    before it calls the openldap function 'ldap_count_values' is
    ldap_get_values(), which is what is returning the memory address of
    0x55a0bfe0. But if it were in fact a problem with openldap, would the
    cli ldapsearch fail as well?

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

    [2006-09-26 11:08:50] madcoder at gmail dot com

    I've tried, but the program doesn't segfault, so it exits normally.
    I'm not very experienced with gdb, so I'm not sure how to give it a
    breakpoint of ldap_count_values (I tried 'break ldap_count_values' and
    'break ldap_count_values()', and it doesn't break).

    It does still return the information as expected.

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

    [2006-09-26 10:57:53] [email]tony2001@php.net[/email]

    Is it possible to perform the same actions using ldapsearch utility in
    console?

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    madcoder at gmail dot com Guest

  10. #29

    Default #38819 [Opn->Csd]: segfault in ldap_get_entries()

    ID: 38819
    User updated by: madcoder at gmail dot com
    Reported By: madcoder at gmail dot com
    -Status: Open
    +Status: Closed
    Bug Type: LDAP related
    Operating System: 2.6.17-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    Sorry, it appears I added that in the wrong place. I added it to the
    Makefile for ext/ldap, and it compiled, and works *without* any
    segfaults.

    I don't want to sound rude, so please don't take this the wrong way,
    .... But wouldn't it be beneficial to take the OpenLDAP developers'
    advice, and rewrite this so-called "deprecated" use of OpenLDAP? It
    appears to only occur on certain machines, perhaps even only on certain
    amd64 machines, but it is still rather annoying if no one is sure what
    causes it, and it takes 2 weeks (or longer, in my case, since I've been
    having this problem long before I posted to any trackers) to get an
    answer from someone.

    Thanks again for your help, and patience while working through this
    problem.


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

    [2006-10-02 11:20:50] madcoder at gmail dot com

    In ext/ldap/config.m4, I changed the following to add the flag you
    mentioned:
    > CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"
    Then reconfigured and rebuilt php. I'm not sure if I did that
    properly, but from what information I found about the flag, that is
    appropriate.

    And I *do* still get the segfault. Should I try a distclean as well?
    Or should I recompile OpenLDAP first (with or without that flag)?

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

    [2006-10-02 09:20:13] [email]tony2001@php.net[/email]

    So does it work for you if you add that magical -DLDAP_DEPRECATED=1 ?

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

    [2006-10-01 08:16:08] madcoder at gmail dot com

    For reference, I'm cross-posting a bug report I've opened with OpenLDAP
    (ITS# 4690) in case they can provide any further information:
    [url]http://www.openldap.org/its/index.cgi/Incoming?id=4690;expression=ldap_get_values;statet ype=-1[/url]

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

    [2006-09-30 03:37:13] madcoder at gmail dot com

    Any other ideas? This problem is kind of a blocker for me right now...
    I still don't understand why it works fine inside valgrind, but it
    segfaults on its own and inside gdb. I know it's segfaulting because
    of the message "Cannot access memory at address 0x55a0bfe0", so the for
    loop checking vals[i] obviously fails. But what steps can I take to
    debug this further?

    It could be a problem in openldap, since the line in php's ldap.c just
    before it calls the openldap function 'ldap_count_values' is
    ldap_get_values(), which is what is returning the memory address of
    0x55a0bfe0. But if it were in fact a problem with openldap, would the
    cli ldapsearch fail as well?

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

    [2006-09-26 11:08:50] madcoder at gmail dot com

    I've tried, but the program doesn't segfault, so it exits normally.
    I'm not very experienced with gdb, so I'm not sure how to give it a
    breakpoint of ldap_count_values (I tried 'break ldap_count_values' and
    'break ldap_count_values()', and it doesn't break).

    It does still return the information as expected.

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    madcoder at gmail dot com Guest

  11. #30

    Default #38819 [Csd->Fbk]: segfault in ldap_get_entries()

    ID: 38819
    Updated by: [email]tony2001@php.net[/email]
    Reported By: madcoder at gmail dot com
    -Status: Closed
    +Status: Feedback
    Bug Type: LDAP related
    Operating System: 2.6.17-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:
    >works *without* any segfaults.
    Ok, great. Please don't close the report until the issue is resolved in
    PHP.
    Could you please also ask OpenLDAP developers if this flag would affect
    anything else? I.e. if it didn't segfault before, could this flag add
    any problems?
    If no, I'll add it to the config.m4, so it'll be defined in all
    builds.
    >But wouldn't it be beneficial to take the OpenLDAP
    >developers' advice, and rewrite this so-called
    >"deprecated" use of OpenLDAP?
    Sure it would be. And we would gladly accept their help.
    But the current situation is that ext/ldap maintainer is not active for
    a long time and nobody really interested in ldap. If you can help us
    with that - you're welcome.

    Also, it would be good if OpenLDAP developers keep the backward
    compatibility, since we cannot rely on users using the most
    latest-and-greatest OpenLDAP version and rewrite ext/ldap each time
    they change the API.


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

    [2006-10-02 11:32:34] madcoder at gmail dot com

    Sorry, it appears I added that in the wrong place. I added it to the
    Makefile for ext/ldap, and it compiled, and works *without* any
    segfaults.

    I don't want to sound rude, so please don't take this the wrong way,
    .... But wouldn't it be beneficial to take the OpenLDAP developers'
    advice, and rewrite this so-called "deprecated" use of OpenLDAP? It
    appears to only occur on certain machines, perhaps even only on certain
    amd64 machines, but it is still rather annoying if no one is sure what
    causes it, and it takes 2 weeks (or longer, in my case, since I've been
    having this problem long before I posted to any trackers) to get an
    answer from someone.

    Thanks again for your help, and patience while working through this
    problem.

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

    [2006-10-02 11:20:50] madcoder at gmail dot com

    In ext/ldap/config.m4, I changed the following to add the flag you
    mentioned:
    > CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"
    Then reconfigured and rebuilt php. I'm not sure if I did that
    properly, but from what information I found about the flag, that is
    appropriate.

    And I *do* still get the segfault. Should I try a distclean as well?
    Or should I recompile OpenLDAP first (with or without that flag)?

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

    [2006-10-02 09:20:13] [email]tony2001@php.net[/email]

    So does it work for you if you add that magical -DLDAP_DEPRECATED=1 ?

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

    [2006-10-01 08:16:08] madcoder at gmail dot com

    For reference, I'm cross-posting a bug report I've opened with OpenLDAP
    (ITS# 4690) in case they can provide any further information:
    [url]http://www.openldap.org/its/index.cgi/Incoming?id=4690;expression=ldap_get_values;statet ype=-1[/url]

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

    [2006-09-30 03:37:13] madcoder at gmail dot com

    Any other ideas? This problem is kind of a blocker for me right now...
    I still don't understand why it works fine inside valgrind, but it
    segfaults on its own and inside gdb. I know it's segfaulting because
    of the message "Cannot access memory at address 0x55a0bfe0", so the for
    loop checking vals[i] obviously fails. But what steps can I take to
    debug this further?

    It could be a problem in openldap, since the line in php's ldap.c just
    before it calls the openldap function 'ldap_count_values' is
    ldap_get_values(), which is what is returning the memory address of
    0x55a0bfe0. But if it were in fact a problem with openldap, would the
    cli ldapsearch fail as well?

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    tony2001@php.net Guest

  12. #31

    Default #38819 [Com]: segfault in ldap_get_entries()

    ID: 38819
    Comment by: cardoe at gentoo dot org
    Reported By: madcoder at gmail dot com
    Status: No Feedback
    Bug Type: LDAP related
    Operating System: 2.6.17-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    Several other Gentoo users are experiencing this issue as well. The
    issue is still an opened one with no fixes having occurred in PHP. You
    can see the Gentoo bug @ [url]http://bugs.gentoo.org/show_bug.cgi?id=133467[/url]


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

    [2006-10-10 01:00:01] 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".

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

    [2006-10-02 11:42:02] [email]tony2001@php.net[/email]
    >works *without* any segfaults.
    Ok, great. Please don't close the report until the issue is resolved in
    PHP.
    Could you please also ask OpenLDAP developers if this flag would affect
    anything else? I.e. if it didn't segfault before, could this flag add
    any problems?
    If no, I'll add it to the config.m4, so it'll be defined in all
    builds.
    >But wouldn't it be beneficial to take the OpenLDAP
    >developers' advice, and rewrite this so-called
    >"deprecated" use of OpenLDAP?
    Sure it would be. And we would gladly accept their help.
    But the current situation is that ext/ldap maintainer is not active for
    a long time and nobody really interested in ldap. If you can help us
    with that - you're welcome.

    Also, it would be good if OpenLDAP developers keep the backward
    compatibility, since we cannot rely on users using the most
    latest-and-greatest OpenLDAP version and rewrite ext/ldap each time
    they change the API.

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

    [2006-10-02 11:32:34] madcoder at gmail dot com

    Sorry, it appears I added that in the wrong place. I added it to the
    Makefile for ext/ldap, and it compiled, and works *without* any
    segfaults.

    I don't want to sound rude, so please don't take this the wrong way,
    .... But wouldn't it be beneficial to take the OpenLDAP developers'
    advice, and rewrite this so-called "deprecated" use of OpenLDAP? It
    appears to only occur on certain machines, perhaps even only on certain
    amd64 machines, but it is still rather annoying if no one is sure what
    causes it, and it takes 2 weeks (or longer, in my case, since I've been
    having this problem long before I posted to any trackers) to get an
    answer from someone.

    Thanks again for your help, and patience while working through this
    problem.

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

    [2006-10-02 11:20:50] madcoder at gmail dot com

    In ext/ldap/config.m4, I changed the following to add the flag you
    mentioned:
    > CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"
    Then reconfigured and rebuilt php. I'm not sure if I did that
    properly, but from what information I found about the flag, that is
    appropriate.

    And I *do* still get the segfault. Should I try a distclean as well?
    Or should I recompile OpenLDAP first (with or without that flag)?

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

    [2006-10-02 09:20:13] [email]tony2001@php.net[/email]

    So does it work for you if you add that magical -DLDAP_DEPRECATED=1 ?

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    cardoe at gentoo dot org Guest

  13. #32

    Default #38819 [NoF->Csd]: segfault in ldap_get_entries()

    ID: 38819
    Updated by: [email]tony2001@php.net[/email]
    Reported By: madcoder at gmail dot com
    -Status: No Feedback
    +Status: Closed
    Bug Type: LDAP related
    Operating System: 2.6.17-gentoo linux amd64
    PHP Version: 5.1.6
    New Comment:

    The patch adding -DLDAP_DEPRECATED=1 has been committed 18 Oct 2006.


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

    [2007-02-28 14:56:26] cardoe at gentoo dot org

    Several other Gentoo users are experiencing this issue as well. The
    issue is still an opened one with no fixes having occurred in PHP. You
    can see the Gentoo bug @ [url]http://bugs.gentoo.org/show_bug.cgi?id=133467[/url]

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

    [2006-10-10 01:00:01] 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".

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

    [2006-10-02 11:42:02] [email]tony2001@php.net[/email]
    >works *without* any segfaults.
    Ok, great. Please don't close the report until the issue is resolved in
    PHP.
    Could you please also ask OpenLDAP developers if this flag would affect
    anything else? I.e. if it didn't segfault before, could this flag add
    any problems?
    If no, I'll add it to the config.m4, so it'll be defined in all
    builds.
    >But wouldn't it be beneficial to take the OpenLDAP
    >developers' advice, and rewrite this so-called
    >"deprecated" use of OpenLDAP?
    Sure it would be. And we would gladly accept their help.
    But the current situation is that ext/ldap maintainer is not active for
    a long time and nobody really interested in ldap. If you can help us
    with that - you're welcome.

    Also, it would be good if OpenLDAP developers keep the backward
    compatibility, since we cannot rely on users using the most
    latest-and-greatest OpenLDAP version and rewrite ext/ldap each time
    they change the API.

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

    [2006-10-02 11:32:34] madcoder at gmail dot com

    Sorry, it appears I added that in the wrong place. I added it to the
    Makefile for ext/ldap, and it compiled, and works *without* any
    segfaults.

    I don't want to sound rude, so please don't take this the wrong way,
    .... But wouldn't it be beneficial to take the OpenLDAP developers'
    advice, and rewrite this so-called "deprecated" use of OpenLDAP? It
    appears to only occur on certain machines, perhaps even only on certain
    amd64 machines, but it is still rather annoying if no one is sure what
    causes it, and it takes 2 weeks (or longer, in my case, since I've been
    having this problem long before I posted to any trackers) to get an
    answer from someone.

    Thanks again for your help, and patience while working through this
    problem.

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

    [2006-10-02 11:20:50] madcoder at gmail dot com

    In ext/ldap/config.m4, I changed the following to add the flag you
    mentioned:
    > CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"
    Then reconfigured and rebuilt php. I'm not sure if I did that
    properly, but from what information I found about the flag, that is
    appropriate.

    And I *do* still get the segfault. Should I try a distclean as well?
    Or should I recompile OpenLDAP first (with or without that flag)?

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

    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
    [url]http://bugs.php.net/38819[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38819&edit=1[/url]
    tony2001@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139