Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 180391 - dev-lang/php with USE="oci8 ldap" has conflict between Oracle LDAP libraries and OpenLDAP
Summary: dev-lang/php with USE="oci8 ldap" has conflict between Oracle LDAP libraries ...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
: 193517 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-05-30 20:28 UTC by David Leinbach
Modified: 2008-04-22 10:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
php5_2-sapi.eclass.diff (php5_2-sapi.eclass.diff,1.42 KB, patch)
2007-08-17 02:09 UTC, Jakub Moc (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Leinbach 2007-05-30 20:28:10 UTC
If you compile dev-lang/php with USE="oci8 ldap", when accessing a database from a PHP script, php crashes with and the following appears in the Apache error_log:

apache2: getentry.c:35: ldap_first_entry: Assertion `( (ld)->ld_options.ldo_vali
d == 0x2 )' failed.
[Wed May 30 08:07:55 2007] [notice] child pid 13451 exit signal Aborted (6)



Reproducible: Always

Steps to Reproduce:
1. Compile dev-lang/php with USE="oci8 ldap"
2. Run a php script that accesses an oracle database

Actual Results:  
A blank page is returned to the browser and the apache error log shows:

apache2: getentry.c:35: ldap_first_entry: Assertion `( (ld)->ld_options.ldo_vali
d == 0x2 )' failed.
[Wed May 30 08:07:55 2007] [notice] child pid 13451 exit signal Aborted (6)

Expected Results:  
The page is generated properly

This is because the Oracle client has built-in LDAP libraries but the PHP eclass  just uses the OpenLDAP libraries and therefore a conflict results.  This can be resolved by specifying the path for the LDAP libraries to be the ORACLE_HOME.  A possible fix to to change /usr/portage/eclass/php5_2-sapi.class lines 508 - 511 to something similar to

    if use ldap || phpconfutils_usecheck ldap ; then
        if use oci8 ; then
            phpconfutils_extension_with     "ldap"          "ldap"          1 "${ORACLE_HOME}"
        else
            phpconfutils_extension_with     "ldap"          "ldap"          1
            phpconfutils_extension_with     "ldap-sasl"     "ldap-sasl"     0
        fi
    fi

This has been tested using the oci8 and ldap use flags with the Oracle 10.2.0.3 client (not instant client) and confirmed to work but has not been tested in other configurations.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-05-31 11:01:25 UTC
Hmmm, USE="oci8" is unsupported, since we can't test it at all. Tobias, ideas about this?
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2007-08-10 15:21:31 UTC
(In reply to comment #0)
> A possible fix to to change /usr/portage/eclass/php5_2-sapi.class
> lines 508 - 511 to something similar to
> 
>     if use ldap || phpconfutils_usecheck ldap ; then
>         if use oci8 ; then
>             phpconfutils_extension_with     "ldap"          "ldap"          1
> "${ORACLE_HOME}"
>         else
>             phpconfutils_extension_with     "ldap"          "ldap"          1
>             phpconfutils_extension_with     "ldap-sasl"     "ldap-sasl"     0
>         fi
>     fi
 
Looks like a correct solution for this mess according to upstream, e.g.

http://bugs.php.net/bug.php?id=4698
http://bugs.php.net/bug.php?id=16005

Tobias, please verify and apply this to eclasses, thanks.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-08-17 02:09:49 UTC
Created attachment 128355 [details, diff]
php5_2-sapi.eclass.diff

Here's a more complete fix, also avoids bogus dependency on openldap w/ USE=oci8 and bails out when USE="ldap-sasl oci8" are both set, as that's not supported w/ LDAP libs provided by Oracle (correct me if I'm wrong).
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-08-27 11:21:43 UTC
Should be fixed in CVS for php-4.4 and php-5.2, please resync in an hour or two and test. 

Note that we are not touching php-5.1 since it's unmaintained and going to be package.masked soon.
Comment 5 David Leinbach 2007-08-28 18:55:19 UTC
I re-compiled PHP 5.2 after this change was applied and it is working for me.  Thanks.
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-08-28 18:59:26 UTC
Cool! Thanks for reporting back.
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-09-24 17:08:35 UTC
*** Bug 193517 has been marked as a duplicate of this bug. ***