Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure using LDAP #41

Closed
cthielen opened this issue Aug 8, 2013 · 3 comments
Closed

Assertion failure using LDAP #41

cthielen opened this issue Aug 8, 2013 · 3 comments

Comments

@cthielen
Copy link

cthielen commented Aug 8, 2013

My development machine uses ruby-oci8 against the Oracle Instant Client (OS X) just fine. When I move to production (Ubuntu 64-bit), I encounter some errors.

ruby-oci8 actually continues to work fine under a simple 'irb' but when I switch to using 'bundle exec rake my_oracle_task', the OCI8.new line fails with the following:

user@host:~$ bundle exec rake banner:import
ruby: getentry.c:35: ldap_first_entry: Assertion `( (ld)->ldc->ldc_options.ldo_valid == 0x2 )' failed.

From reading around the Internet, it appears this problem may be related to another library using the system LDAP (openldap?) instead of the Oracle functions. I have no idea what that other library would be.

I think this is related: http://stackoverflow.com/a/15322554/98647

Do you have any idea what's going on here and how I can go about debugging? I've wasted a few hours trying various things like following his suggestions in modifying ruby-oci8 to adjusting the order of gems loaded in Bundler, etc.

@cthielen
Copy link
Author

cthielen commented Aug 8, 2013

I do have some backtrace information on this, specifically:

-- C level backtrace information -------------------------------------------
/home/deployer/.rbenv/versions/2.0.0-p247/bin/ruby(+0x152865) [0x7fd99837a865]
/home/deployer/.rbenv/versions/2.0.0-p247/bin/ruby(+0x1a727c) [0x7fd9983cf27c]
/home/deployer/.rbenv/versions/2.0.0-p247/bin/ruby(rb_bug+0xb7) [0x7fd9983d0c27]
/home/deployer/.rbenv/versions/2.0.0-p247/bin/ruby(+0xdc61e) [0x7fd99830461e]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7fd997df5cb0] ocihandle.c:599
/usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2(ldap_first_entry+0xc) [0x7fd992ee913c] oranumber_util.c:315
/opt/oracle/instantclient_12_1/libclntsh.so.12.1(nnflgne+0x11b0) [0x7fd98c4ae8a0]
/opt/oracle/instantclient_12_1/libclntsh.so.12.1(+0x1666bb2) [0x7fd98c4a0bb2]
/opt/oracle/instantclient_12_1/libclntsh.so.12.1(+0x1675e7c) [0x7fd98c4afe7c]
/opt/oracle/instantclient_12_1/libclntsh.so.12.1(nnfgrne+0x289) [0x7fd98b3f35d9]
/opt/oracle/instantclient_12_1/libclntsh.so.12.1(nlolgobj+0x151) [0x7fd98b56a151]

That ldap_first_entry() seems to be the libldap coming from the GNU system though I think oranumber_util.c is supposed to use the one from Instant Client?

@cthielen
Copy link
Author

cthielen commented Aug 9, 2013

I was able to work around this by loading 'oci8' before 'pg' as Ubuntu's standard libpg is linked against libldap which has the conflicting symbol name.

Is it possible for ruby-oci8 to explicitly use the functions in Oracle Instant Client's libclntsh.so to avoid this workaround?

@kubo
Copy link
Owner

kubo commented Aug 9, 2013

Is it possible for ruby-oci8 to explicitly use the functions in Oracle Instant Client's libclntsh.so to avoid this workaround?

Impossible.

I think that Oracle Corporation can fix the symbol conflict issue if Oracle Instant Client libclntsh.so is linked with the following version scripts not to export LDAP functions.

{
global:
    OCI*; /* export symbols which start OCI. */
local:
    *;  /* All others are hidden. */
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants