[MDEV-4020] libmyodbc relocation error with MariaDB on CentOS 5 Created: 2013-01-10  Updated: 2014-06-12  Resolved: 2013-04-03

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.0, 5.5.28a
Fix Version/s: 5.5.31, 5.3.12

Type: Bug Priority: Major
Reporter: Nicolay Vizovitin (Inactive) Assignee: Daniel Bartholomew
Resolution: Fixed Votes: 0
Labels: upstream
Environment:
  1. cat /etc/issue; uname -m
    CentOS release 5.8 (Final)
    Kernel \r on an \m

x86_64

System: Linux a10-52-75-225.qa.plesk.ru 2.6.18-028stab099.3 #1 SMP Wed Mar 7 15:20:22 MSK 2012 x86_64 x86_64 x86_64 GNU/Linux
Compilation info (call): CC='/usr/bin/gcc' CFLAGS='-Wall -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1' CXX='/usr/bin/c++' CXXFLAGS='-Wall -Wall -Wno-unused-parameter -fno-exceptions -fno-rtti -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1' LDFLAGS='' ASFLAGS=''
Compilation info (used): CC='/usr/bin/gcc' CFLAGS='-Wall -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1' CXX='/usr/bin/c++' CXXFLAGS='-Wall -Wall -Wno-unused-parameter -fno-exceptions -fno-rtti -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1' LDFLAGS='' ASFLAGS=''
LIBC:
lrwxrwxrwx 1 root root 11 May 23 2012 /lib/libc.so.6 -> libc-2.5.so
-rwxr-xr-x 1 root root 1686312 Apr 20 2012 /lib/libc-2.5.so



 Description   

libmyodbc on this system is not usable with MariaDB MySQL compatibility layer (MariaDB-compat) due to relocation error. This can be demonstrated with isql or iusql utilities from unixODBC package (unixODBC64 will do as well):

[root@a10-52-75-225 ~]# echo "" | isql -b apsc
isql: relocation error: /usr/lib64/libmyodbc3.so: symbol strmov, version libmysqlclient_15 not defined in file libmysqlclient.so.15 with link time reference
[root@a10-52-75-225 ~]# strings /usr/lib64/libmyodbc3.so | grep strmov
strmov
[root@a10-52-75-225 ~]# strings /usr/lib64/libmysqlclient.so.15 | grep strmov
[root@a10-52-75-225 ~]# rpm -qf /usr/lib64/libmysqlclient.so.15
MariaDB-compat-10.0.0-1
[root@a10-52-75-225 ~]# rpm -qf /usr/lib64/libmyodbc3.so
mysql-connector-odbc-3.51.26r1127-2.el5

This assumes following sample odbc configuration:

[root@a10-52-75-225 ~]# cat /etc/odbc.ini
[apsc]
Description = Sample MySQL database (DSN)
Driver      = MySQL
SERVER      = localhost
USER        = apsc
PASSWORD    = HDA0edvGpCvs
PORT        = 3306
DATABASE    = apsc
 
[root@a10-52-75-225 ~]# tail -n 9 /etc/odbcinst.ini
[MySQL]
Description = Sample MySQL driver
Driver      = /usr/lib64/libmyodbc3.so
Setup       =
FileUsage   = 1
Driver64    = /usr/lib64/libmyodbc3.so
Setup64     =
UsageCount  = 1

This was done on CentOS 5 x64 machine with MariaDB 10.0, but same issues were observed with MariaDB 5.5. Also this most probably happens on other architectures and RedHat el5, maybe on RedHat/CentOS 6 as well.



 Comments   
Comment by Elena Stepanova [ 2013-01-11 ]

I'm getting the same error with the MySQL very own library:

[[root@localhost /]# echo "" | isql -b apsc
isql: relocation error: /usr/lib64/libmyodbc3.so: symbol strmov, version libmysqlclient_15 not defined in file libmysqlclient.so.15 with link time reference
[root@localhost /]# rpm -qf /usr/lib64/libmyodbc3.so
mysql-connector-odbc-3.51.26r1127-2.el5
[root@localhost /]# rpm -qf /usr/lib64/libmysqlclient.so.15
MySQL-shared-compat-5.5.29-1.rhel5
[root@localhost /]# strings /usr/lib64/libmysqlclient.so.15 | grep strmov
strmov_overlapp

Comment by Elena Stepanova [ 2013-01-11 ]

Also found these bug reports:
https://bugs.launchpad.net/ius/+bug/942524
https://bugs.launchpad.net/ius/+bug/1046974

Wlad, could you please take a look to see if there is anything that can and needs to be done on our side?

Comment by Vladislav Vaintroub [ 2013-01-11 ]

It appears to be a CentOS problem, and I'm not sure how we can help here.

Problem 1) The actual problem is that myodbc should not be built with shared client, because it uses a bunch of functions that are not in MySQL API (strmov, strxmov, srtrend, list_add, etc). MyODBC was always built with static client library (which is helpfully compiled with -fPIC, so linking it tio shared libraries is always possible)

Problem 2) CentOS binaries, distributed by both MySQL and MariaDB (and, I'm pretty sure Percona) do not have strmov() defined. CentOS own MySQL "fork" has strmov defined, due to the patch http://bazaar.launchpad.net/~ius-coredev/ius/mysqlclient16/view/3/SOURCES/mysql-strmov.patch . That patch breaks a lot of things, and you experience that break. Not only MariaDB is affected, stock MySQL is affected too

How to fix:

  • I prefer CentOS to fix what's broken. I see the intention behind shared linking and even behin the overly careful strmov patch, but this breaks more than it fixes.
  • A combination of myodbc from Oracle and MariaDB from us will work, with client libraries either from Oracle or from us. CentOS client libraries do not mix with either vendor.
Comment by Vladislav Vaintroub [ 2013-01-11 ]

Colin, since I suspect you might know how to contact CentOS folks to file a bugreport (but if you do not , please assign back, I'll find that out)

Comment by Vladislav Vaintroub [ 2013-01-11 ]

In 5.5 RPMs, the fixed 5.3 libraries will appear only after the next 5.5 after 5.3.12

Comment by Vladislav Vaintroub [ 2013-04-03 ]

5.3.12 that was released in January has this problem fixed.

objdump -T /path/to/libmysqlclient_r.so.16 |grep strmov
lists strmov and strmov_overlapped.

However, shared-compat package that comes with 5.5.30 seems to come with outdated libmysqlclient*.so.16 in shared-compat.rpm (the above objdump command does not list strmov). A user recently posted comment about that to MDEV-4361.

Daniel, can you check whether automation works ok here? I do not know much about how creation of compat packages work, I assume you do. If not , please to reassign to serg.

Comment by Daniel Bartholomew [ 2013-04-03 ]

Ok, I think the fix is to update the mariadb-shared rpms we use to the 5.3.12 version (they're from an older 5.3 version now).

I'll make the update, backing up the old rpms first.

Comment by Daniel Bartholomew [ 2013-04-03 ]

Wlad has confirmed that the changes I made in buildbot have fixed this issue. The next release of 5.5 will have the fix.

Comment by David Zambonini [ 2014-06-12 ]

Sorry, I do not know if this is the correct way to report this but there appears to be a regression in this workaround – using MariaDB 5.5.38 (from yum.mariadb.org);

  1. cat /etc/redhat-release
    CentOS release 5.10 (Final)
  1. rpm -qf /usr/bin/isql
    unixODBC-2.2.11-10.el5

/usr/bin/isql: relocation error: /usr/lib/libmyodbc3.so: symbol strmov, version libmysqlclient_15 not defined in file libmysqlclient.so.15 with link time reference

  1. objdump -T /usr/lib/libmysqlclient.so.15 | grep strmov
    returns blank.
  2. rpm -qf /usr/lib/libmysqlclient.so.15
    MariaDB-compat-5.5.38-1
Generated at Thu Feb 08 06:53:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.