Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4020

libmyodbc relocation error with MariaDB on CentOS 5

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.0, 5.5.28a
    • Fix Version/s: 5.5.31, 5.3.12
    • Component/s: None
    • Labels:
    • Environment:

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment - - edited

            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

            Show
            elenst Elena Stepanova added a comment - - edited 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
            Hide
            elenst Elena Stepanova added a comment -

            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?

            Show
            elenst Elena Stepanova added a comment - 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?
            Hide
            wlad Vladislav Vaintroub added a comment -

            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.
            Show
            wlad Vladislav Vaintroub added a comment - 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.
            Hide
            wlad Vladislav Vaintroub added a comment -

            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)

            Show
            wlad Vladislav Vaintroub added a comment - 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)
            Hide
            wlad Vladislav Vaintroub added a comment -

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

            Show
            wlad Vladislav Vaintroub added a comment - In 5.5 RPMs, the fixed 5.3 libraries will appear only after the next 5.5 after 5.3.12
            Hide
            wlad Vladislav Vaintroub added a comment -

            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.

            Show
            wlad Vladislav Vaintroub added a comment - 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.
            Hide
            dbart Daniel Bartholomew added a comment -

            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.

            Show
            dbart Daniel Bartholomew added a comment - 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.
            Hide
            dbart Daniel Bartholomew added a comment -

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

            Show
            dbart Daniel Bartholomew added a comment - Wlad has confirmed that the changes I made in buildbot have fixed this issue. The next release of 5.5 will have the fix.
            Hide
            dzambonini David Zambonini added a comment -

            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
            Show
            dzambonini David Zambonini added a comment - 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); cat /etc/redhat-release CentOS release 5.10 (Final) 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 objdump -T /usr/lib/libmysqlclient.so.15 | grep strmov returns blank. rpm -qf /usr/lib/libmysqlclient.so.15 MariaDB-compat-5.5.38-1

              People

              • Assignee:
                dbart Daniel Bartholomew
                Reporter:
                dfl Nicolay Vizovitin
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 30 minutes
                  4h 30m