undefined reference to `my_net_read'

Bug #803982 reported by Olivier Doucet on 2011-06-30
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
MySQL Data Dumper
Undecided
Unassigned
Fedora
New
Undecided
Unassigned
Mandriva
New
Undecided
Unassigned

Bug Description

When compiling latest version (bzr branch) or 0.2.3 release :

CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/usr/src/mydumper/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2

"cmake ." echoed the following :

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/lib64/ccache/gcc
-- Check for working C compiler: /usr/lib64/ccache/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using mysql-config: /usr/bin/mysql_config
-- Found MySQL: /usr/include/mysql, /usr/lib64/mysql/libmysqlclient.so;/usr/lib64/libpthread.so;/usr/lib64/libz.so;/usr/lib64/libm.so;/usr/lib64/librt.so;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;/usr/lib64/libdl.so
-- Found ZLIB: /usr/include (found version "1.2.5")
-- checking for one of the modules 'glib-2.0'
-- checking for one of the modules 'gthread-2.0'
-- checking for module 'libpcre'
-- found libpcre, version 8.12
-- Found PCRE: /usr/include

Andrew Hutchings (linuxjedi) wrote :

Hi Olivier,

Which OS is this and which version of MySQL are you using?

Changed in mydumper:
status: New → Incomplete
Olivier Doucet (odoucet) wrote :

Hello,
I'm using Fedora 15 (x86_64).
Package mysql and mysql-devel version 5.5.13

Changed in mydumper:
status: Incomplete → New
Andrew Hutchings (linuxjedi) wrote :

Hello Olivier,

Unfortunately Fedora strip out needed symbols from their MySQL libraries. I do not know of any good workaround for this beyond compiling your own MySQL binaries or using a different set of binaries.

Changed in mydumper:
status: New → Won't Fix
Domas Mituzas (domas-mituzas) wrote :

or not having feature enabled, but that requires cmake/code crap

Andrew Hutchings (linuxjedi) wrote :

That is also an option, but since it only affects Fedora 15 (I don't think even 14 is affected and RHEL isn't affected) is the effort to work around a Fedora bug worth it?

symbianflo (symbianflo) wrote :

Hi folx same here on mandriva 2011.0 x86_64 ,mysquel 5.5.14:
***************
CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/home/symbianflo/rpmbuild/BUILD/mydumper-0.5.0/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 85%] Built target doc_html
make: *** [all] Error 2
************************
Can you fix it please,

Andrew Hutchings (linuxjedi) wrote :

Hi symbianflo,

This is because Mandriva also strip their binaries. Please use binaries supplied by Oracle/MariaDB/etc... instead.

I may have a way of working around this in the future, but that won't be until at least 0.6.

symbianflo (symbianflo) wrote :

Ok then you renounce to be ported and distribuited on all distributions that strip the mysql binaries .
I'll only try to help , I had a package request for mydumper , but I'll add a tag the request : " won't fix"

http://www.mandrivausers.ro/content/mydumper-status-wont-fix

Andrew Hutchings (linuxjedi) wrote :

I believe RedHat/Fedora have managed to solve this issue themselves I am trying to find out how.

If you can find a way of fixing this without either including the entire libmysqlclient source in mydumper or disabling 50% of the functionality of mydumper please let me know.

Andrew Hutchings (linuxjedi) wrote :

OK, I have found the cause. In the Fedora MySQL .spec file:

* Thu Dec 23 2010 Tom Lane <email address hidden> 5.5.8-1
- Update to MySQL 5.5.8 (major version bump). Note this includes removal
  of libmysqlclient_r.so.
- Add a linker version script to hide libmysqlclient functions that aren't
  part of the documented API.

That last entry trimmed out the required part of the API required by mydumper. I assume Mandriva uses this .spec too. I will file a feature request with RedHat to add it back in.

Andrew Hutchings (linuxjedi) wrote :

Filed the following feature request with RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=728634

symbianflo: I suggest Mandriva fixes this too so that mydumper can compile on it.

Andrew Hutchings (linuxjedi) wrote :

RedHat don't want to fix this without Oracle documenting this part of the API. I understand their point of view. I have an alternative way of doing it planned but it will take a few months to develop.

symbianflo (symbianflo) wrote :

- 5.5.10
- note, the major was bumped from 16 to 18, so..., a major rebuild has
  to be done of all the packages linking to the mysqlclient libraries.
- sync with fedora documented API policy

since 5.5.10 mandriva use rh/fedora's approach sorry wont be fixed

Domas Mituzas (domas-mituzas) wrote :

there's alternative of not linking in binlog.c for the poor souls.

we don't need this extra libmysqlclient functionality for base mydumper work.

p4guru (p4guru) wrote :

I know the status is set to won't fix, but what's the work around, having exact same issue with MySQL 5.5.19 for CentOS 6.2

-- Build files have been written to: /usr/local/src/mydumper-0.5.1
Scanning dependencies of target mydumper
[ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
[ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/usr/local/src/mydumper-0.5.1/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2

p4guru (p4guru) wrote :

looks like Remi 5.5 repo will have a fix for this http://forums.famillecollet.com/viewtopic.php?pid=3843 just wish official would.

p4guru (p4guru) wrote :

Any updates for workarounds ?

Mydumper 0.5.1/0.5.2 worked with MariaDB 5.5.x up to MariaDB 5.5.24 for compiling. But seems MariaDB 5.5.30 now has same error compiling Mydumper 0.5.2

WARNINGUnable to find Sphinx documentation generator
-- ------------------------------------------------
-- MYSQL_CONFIG = /usr/bin/mysql_config
-- CMAKE_INSTALL_PREFIX = /usr/local
-- BUILD_DOCS = ON
-- RUN_CPPCHECK = OFF
-- Change a values with: cmake -D<Variable>=<Value>
-- ------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/mydumper-0.5.2
Scanning dependencies of target mydumper
[ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
[ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/usr/local/src/mydumper-0.5.2/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2

Keith Murphy (bmurphy) wrote :

It appears that this is affecting Percona 5.5 builds now as well:

# rpm -qa | grep -i percon
Percona-Server-shared-compat-5.5.32-rel31.0.549.rhel6.x86_64
Percona-Server-shared-55-5.5.32-rel31.0.549.rhel6.x86_64
Percona-Server-server-55-5.5.32-rel31.0.549.rhel6.x86_64
percona-xtrabackup-2.1.3-608.rhel6.x86_64
Percona-Server-devel-55-5.5.32-rel31.0.549.rhel6.x86_64
Percona-Server-client-55-5.5.32-rel31.0.549.rhel6.x86_64
 #

 ~/mydumper-0.5.2] # make
Scanning dependencies of target mydumper
[ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
[ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/root/mydumper-0.5.2/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2

p4guru (p4guru) wrote :

FYI, Vladislav Vaintroub from MariaDB provided a patch for mydumper which works with MariaDB 5.5 https://mariadb.atlassian.net/browse/MDEV-4554

might work with Percona 5.5 too ?

jbrahy (jbrahy) wrote :

[<email address hidden>]# cmake . -DMYSQL_LIBRARIES_mysqlclient_r=/usr/lib64/libmysqlclient_r.a
-- Using mysql-config: /usr/bin/mysql_config
-- Found MySQL: /usr/include/mysql, /usr/lib64/libmysqlclient_r.so;/usr/lib64/libpthread.so;/usr/lib64/libm.so;/usr/lib64/librt.so;/usr/lib64/libssl.so;/usr/lib64/libcrypto.so;/usr/lib64/libdl.so

-- ------------------------------------------------
-- MYSQL_CONFIG = /usr/bin/mysql_config
-- CMAKE_INSTALL_PREFIX = /usr/local
-- BUILD_DOCS = ON
-- RUN_CPPCHECK = OFF
-- Change a values with: cmake -D<Variable>=<Value>
-- ------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/backups/mydumper-0.5.2
[<email address hidden>]# make
make[2]: *** No rule to make target `/usr/lib64/libmysqlclient_r.a', needed by `mydumper'. Stop.
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2
[<email address hidden>]#

doesn't seem to fix it on Percona, using 55-5.5.34.

itxx (itxx00) wrote :

[root@localhost mydumper-0.6.0]# make
[ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
[ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/root/pkgs/mydumper-0.6.0/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2
[root@localhost mydumper-0.6.0]# cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m

[root@localhost mydumper-0.6.0]# rpm -qa|grep -i percona
Percona-Server-shared-compat-5.5.34-rel32.0.591.rhel6.x86_64
Percona-Server-server-55-5.5.34-rel32.0.591.rhel6.x86_64
percona-release-0.0-1.x86_64
Percona-Server-shared-55-5.5.34-rel32.0.591.rhel6.x86_64
Percona-Server-client-55-5.5.34-rel32.0.591.rhel6.x86_64
percona-toolkit-2.2.5-2.noarch
Percona-Server-devel-55-5.5.34-rel32.0.591.rhel6.x86_64
percona-xtrabackup-2.1.6-702.rhel6.x86_64

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.