#38882 [NEW]: ldap_connect causes Segmentation fault

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

  1. #21

    Default #38882 [Opn->Fbk]: ldap_connect causes Segmentation fault

    ID: 38882
    Updated by: [email]tony2001@php.net[/email]
    Reported By: d dot wynne at ljmu dot ac dot uk
    -Status: Open
    +Status: Feedback
    Bug Type: LDAP related
    Operating System: SuSE 10.1 x86_64
    PHP Version: 4.4.4
    New Comment:

    Apply this patch, run make clean && ./buildconf && ./config.nice &&
    make

    Index: ext/ldap/config.m4
    ================================================== =================
    RCS file: /repository/php-src/ext/ldap/config.m4,v
    retrieving revision 1.26.2.8.2.1
    diff -u -p -d -r1.26.2.8.2.1 config.m4
    --- ext/ldap/config.m4 3 Nov 2005 20:41:56 -0000 1.26.2.8.2.1
    +++ ext/ldap/config.m4 4 Oct 2006 15:12:48 -0000
    @@ -23,7 +23,7 @@ PHP_ARG_WITH(ldap,for LDAP support,

    if test "$PHP_LDAP" != "no"; then

    - PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared)
    + PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1)

    if test "$PHP_LDAP" = "yes"; then
    for i in /usr/local /usr; do



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

    [2006-10-04 14:49:23] d dot wynne at ljmu dot ac dot uk

    Sticking with:

    openldap2-2.3.19
    php 4.4.4

    Certainly the introduction of ldap:// in front of the hostname stopped
    the Segmentatio fault on the ldap_connect. The script still
    Segmentation faulted later on as there are lots of ldap_* functions.

    I also was unsure of where to put:

    -DLDAP_DEPRECATED=1

    In php 4.4.4 there is no Makefile in ext/ldap, so in config.m4:

    CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"

    changed to:

    CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"

    Still Segfaults, but looking at the output of make the
    -DLDAP_DEPRECATED=1 didn't seem to be getting passed.

    Instead changed the "top-level" Makefile, there are 3 "libtool" lines,
    and changed -DLDAP_DEPRECATED to -DLDAP_DEPRECATED=1

    $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2
    -DLDAP_DEPRECATED=1 -I/usr/include/apache2-prefork -DLINUX=2
    -D_REENTRANT -D_GNU_SOURCE -I/usr/include -I/usr/include/apr-1
    -Isapi/apache2handler/
    -I/home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/
    $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/sapi_apache2.c
    -o sapi/apache2handler/sapi_apache2.lo
    sapi/apache2handler/apache_config.lo:
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/apache_config.c
    $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2
    -DLDAP_DEPRECATED=1 .....

    Again still segfaults.

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

    [2006-10-02 22:11:57] [email]tony2001@php.net[/email]

    See also bug #38819 and the solution inside.
    Let us know if it works for you.

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

    [2006-09-29 15:04:24] d dot wynne at ljmu dot ac dot uk

    OK, Built & installed. Presumably now there's some new options or
    statements to the /usr/bin/php CLI script with the ldap_connect
    statement.

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

    [2006-09-29 14:45:19] [email]tony2001@php.net[/email]

    `make clean` is required.

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

    [2006-09-29 14:44:04] d dot wynne at ljmu dot ac dot uk

    ......
    Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo
    Zend/zend_multibyte.lo
    Zend/zend_strtod.lo Zend/zend_execute.lo sapi/cli/php_cli.lo
    sapi/cli/getopt.lo
    main/internal_functions_cli.lo -lcrypt -lcrypt -lsybdb -lldap -llber
    -lresolv -
    lm -ldl -lnsl -lssl -lcrypto -ldl -ldl -lm -lnsl -lirc -lclntsh -lcrypt
    -lcrypt
    -o sapi/cli/php
    ext/standard/info.lo: In function `php_info_print_table_header':
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/ext/standard/info.c:756:
    undefined refere
    nce to `ts_resource_ex'
    ext/standard/info.lo: In function `php_info_print_table_row':
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/ext/standard/info.c:800:
    undefined refere
    nce to `ts_resource_ex'
    ext/standard/info.lo: In function `php_print_gpcse_array':
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/ext/standard/info.c:119:
    undefined refere
    nce to `executor_globals_id'
    ext/standard/info.lo: In function `php_info_write_wrapper':
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/ext/standard/info.c:67:
    undefined referen
    ce to `ts_resource_ex'
    ext/standard/info.lo: In function `php_print_info':
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/ext/standard/info.c:624:
    undefined refere
    nce to `executor_globals_id'
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/ext/standard/info.c:554:
    undefined refere
    nce to `sapi_globals_id'

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

    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/38882[/url]

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

  2. Similar Questions and Discussions

    1. #38882 [Opn->Fbk]: ldap_connect causes Segmentation fault
      ID: 38882 Updated by: tony2001@php.net Reported By: d dot wynne at ljmu dot ac dot uk -Status: Open +Status: ...
    2. Segmentation Fault
      I am running a PHP script from the command line that is returning "Segmentation Fault". I run a lot of script from the command line and have never...
    3. [PHP] Segmentation Fault
      I am running a PHP script from the command line that is returning "Segmentation Fault". I run a lot of script from the command line and have ...
    4. 1.8.0 Segmentation fault
      I have been experiencing problems with the 1.8.0 (MSVC build) causing segmentation faults. In an effort to track down the problem I downloaded the...
    5. Bus Error v Segmentation Fault
      Hello, I was hoping someone could explain the difference between a Bus error and a Segmentation Fault. Specifically what poor programing causes...
  3. #22

    Default #38882 [Fbk->Opn]: ldap_connect causes Segmentation fault

    ID: 38882
    User updated by: d dot wynne at ljmu dot ac dot uk
    Reported By: d dot wynne at ljmu dot ac dot uk
    -Status: Feedback
    +Status: Open
    Bug Type: LDAP related
    Operating System: SuSE 10.1 x86_64
    PHP Version: 4.4.4
    New Comment:

    That worked a charm, I had to do:

    ../buildconf --force

    if, at some later stage I want to re-build PHP --with-gd=/usr for
    example, would running configure "destroy" the ldap fix ? if so, how
    can I re-instate it.

    Many many thanks for your help.


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

    [2006-10-04 15:13:37] [email]tony2001@php.net[/email]

    Apply this patch, run make clean && ./buildconf && ./config.nice &&
    make

    Index: ext/ldap/config.m4
    ================================================== =================
    RCS file: /repository/php-src/ext/ldap/config.m4,v
    retrieving revision 1.26.2.8.2.1
    diff -u -p -d -r1.26.2.8.2.1 config.m4
    --- ext/ldap/config.m4 3 Nov 2005 20:41:56 -0000 1.26.2.8.2.1
    +++ ext/ldap/config.m4 4 Oct 2006 15:12:48 -0000
    @@ -23,7 +23,7 @@ PHP_ARG_WITH(ldap,for LDAP support,

    if test "$PHP_LDAP" != "no"; then

    - PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared)
    + PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1)

    if test "$PHP_LDAP" = "yes"; then
    for i in /usr/local /usr; do


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

    [2006-10-04 14:49:23] d dot wynne at ljmu dot ac dot uk

    Sticking with:

    openldap2-2.3.19
    php 4.4.4

    Certainly the introduction of ldap:// in front of the hostname stopped
    the Segmentatio fault on the ldap_connect. The script still
    Segmentation faulted later on as there are lots of ldap_* functions.

    I also was unsure of where to put:

    -DLDAP_DEPRECATED=1

    In php 4.4.4 there is no Makefile in ext/ldap, so in config.m4:

    CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"

    changed to:

    CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"

    Still Segfaults, but looking at the output of make the
    -DLDAP_DEPRECATED=1 didn't seem to be getting passed.

    Instead changed the "top-level" Makefile, there are 3 "libtool" lines,
    and changed -DLDAP_DEPRECATED to -DLDAP_DEPRECATED=1

    $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2
    -DLDAP_DEPRECATED=1 -I/usr/include/apache2-prefork -DLINUX=2
    -D_REENTRANT -D_GNU_SOURCE -I/usr/include -I/usr/include/apr-1
    -Isapi/apache2handler/
    -I/home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/
    $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/sapi_apache2.c
    -o sapi/apache2handler/sapi_apache2.lo
    sapi/apache2handler/apache_config.lo:
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/apache_config.c
    $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2
    -DLDAP_DEPRECATED=1 .....

    Again still segfaults.

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

    [2006-10-02 22:11:57] [email]tony2001@php.net[/email]

    See also bug #38819 and the solution inside.
    Let us know if it works for you.

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

    [2006-09-29 15:04:24] d dot wynne at ljmu dot ac dot uk

    OK, Built & installed. Presumably now there's some new options or
    statements to the /usr/bin/php CLI script with the ldap_connect
    statement.

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

    [2006-09-29 14:45:19] [email]tony2001@php.net[/email]

    `make clean` is required.

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

    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/38882[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38882&edit=1[/url]
    d dot wynne at ljmu dot ac dot uk Guest

  4. #23

    Default #38882 [Opn->Csd]: ldap_connect causes Segmentation fault

    ID: 38882
    Updated by: [email]tony2001@php.net[/email]
    Reported By: d dot wynne at ljmu dot ac dot uk
    -Status: Open
    +Status: Closed
    Bug Type: LDAP related
    Operating System: SuSE 10.1 x86_64
    PHP Version: 4.4.4
    New Comment:

    This bug has been fixed in CVS.

    Snapshots of the sources are packaged every three hours; this change
    will be in the next snapshot. You can grab the snapshot at
    [url]http://snaps.php.net/[/url].

    Thank you for the report, and for helping us make PHP better.
    >would running configure "destroy" the ldap fix
    No, you can destroy it only by reverting the patch and running
    ../buildconf again.


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

    [2006-10-09 12:12:45] d dot wynne at ljmu dot ac dot uk

    That worked a charm, I had to do:

    ../buildconf --force

    if, at some later stage I want to re-build PHP --with-gd=/usr for
    example, would running configure "destroy" the ldap fix ? if so, how
    can I re-instate it.

    Many many thanks for your help.

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

    [2006-10-04 15:13:37] [email]tony2001@php.net[/email]

    Apply this patch, run make clean && ./buildconf && ./config.nice &&
    make

    Index: ext/ldap/config.m4
    ================================================== =================
    RCS file: /repository/php-src/ext/ldap/config.m4,v
    retrieving revision 1.26.2.8.2.1
    diff -u -p -d -r1.26.2.8.2.1 config.m4
    --- ext/ldap/config.m4 3 Nov 2005 20:41:56 -0000 1.26.2.8.2.1
    +++ ext/ldap/config.m4 4 Oct 2006 15:12:48 -0000
    @@ -23,7 +23,7 @@ PHP_ARG_WITH(ldap,for LDAP support,

    if test "$PHP_LDAP" != "no"; then

    - PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared)
    + PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1)

    if test "$PHP_LDAP" = "yes"; then
    for i in /usr/local /usr; do


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

    [2006-10-04 14:49:23] d dot wynne at ljmu dot ac dot uk

    Sticking with:

    openldap2-2.3.19
    php 4.4.4

    Certainly the introduction of ldap:// in front of the hostname stopped
    the Segmentatio fault on the ldap_connect. The script still
    Segmentation faulted later on as there are lots of ldap_* functions.

    I also was unsure of where to put:

    -DLDAP_DEPRECATED=1

    In php 4.4.4 there is no Makefile in ext/ldap, so in config.m4:

    CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR"

    changed to:

    CPPFLAGS="$CPPFLAGS -I$LDAP_INCDIR -DLDAP_DEPRECATED=1"

    Still Segfaults, but looking at the output of make the
    -DLDAP_DEPRECATED=1 didn't seem to be getting passed.

    Instead changed the "top-level" Makefile, there are 3 "libtool" lines,
    and changed -DLDAP_DEPRECATED to -DLDAP_DEPRECATED=1

    $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2
    -DLDAP_DEPRECATED=1 -I/usr/include/apache2-prefork -DLINUX=2
    -D_REENTRANT -D_GNU_SOURCE -I/usr/include -I/usr/include/apr-1
    -Isapi/apache2handler/
    -I/home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/
    $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/sapi_apache2.c
    -o sapi/apache2handler/sapi_apache2.lo
    sapi/apache2handler/apache_config.lo:
    /home/cmstechs/cmsdwynn/SuSE/php-4.4.4/sapi/apache2handler/apache_config.c
    $(LIBTOOL) --mode=compile $(CC) -D_FORTIFY_SOURCE=2
    -DLDAP_DEPRECATED=1 .....

    Again still segfaults.

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

    [2006-10-02 22:11:57] [email]tony2001@php.net[/email]

    See also bug #38819 and the solution inside.
    Let us know if it works for you.

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

    [2006-09-29 15:04:24] d dot wynne at ljmu dot ac dot uk

    OK, Built & installed. Presumably now there's some new options or
    statements to the /usr/bin/php CLI script with the ldap_connect
    statement.

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

    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/38882[/url]

    --
    Edit this bug report at [url]http://bugs.php.net/?id=38882&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