Bug #14413 Linker fails with "undefined reference to `_create_index_by_sort'"
Submitted: 27 Oct 2005 23:12 Modified: 4 Nov 2005 16:03
Reporter: Thomas Keller Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.15-source OS:Linux (Fedora Core 2)
Assigned to: CPU Architecture:Any

[27 Oct 2005 23:12] Thomas Keller
Description:
Hello!

I'm trying to compile MySQL-5.0.15 on my server (VPS system with FC2, kernel 2.4.20-021stab028.18.777-enterprise, gcc-3.3.3, glibc-2.3). The configure command was the following (it went through without problems):

./configure --with-tcp-port=3307 --with-mysqld-user=mysql5 --with-charset=utf8 --with-collation=utf8_general_ci --prefix=/opt/mysql5 --program-suffix=5

On the same machine exists another 4.0.x installation and I don't want to interfere with that. Unfortunately the RPMs supplied by MySQL.com aren't relocatable, thats why I need to build it from source.

This is the last output:

[...]
gcc -O3 -DDBUG_OFF -rdynamic -o myisamchk myisamchk.o  libmyisam.a ../mysys/libmysys.a ../dbug/libdbug.a ../strings/libmystrings.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
libmyisam.a(mi_check.o)(.text+0x579b): In function `mi_repair_by_sort':
: undefined reference to `_create_index_by_sort'
libmyisam.a(mi_check.o)(.text+0x6217): In function `mi_repair_parallel':
: undefined reference to `thr_find_all_keys'
libmyisam.a(mi_check.o)(.text+0x628a): In function `mi_repair_parallel':
: undefined reference to `thr_write_keys'
collect2: ld returned 1 exit status
make[2]: *** [myisamchk] Error 1
make[2]: Leaving directory `/root/software/mysql-5.0.15/myisam'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/software/mysql-5.0.15'
make: *** [all] Error 2

Tommy.

How to repeat:
Build from source under FC2 using the above configure, I suppose.
[31 Oct 2005 13:57] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat the behaviour you described on my Fedora Core 1. I performed the following steps:

gunzip < mysql-5.0.15.tar.gz | tar xvf -
cd mysql-5.0.15
./configure --with-tcp-port=3307 --with-mysqld-user=mysql5 --with-charset=utf8 --with-collation=utf8_general_ci --prefix=/opt/mysql5 --program-suffix=5
make

make gave me return code 0, it worked OK. I used the following machine:

[openxs@Fedora mysql-5.0.15]$ uname -a
Linux Fedora 2.4.22-1.2115.nptl #1 Wed Oct 29 15:42:51 EST 2003 i686 i686 i386 GNU/Linux
[openxs@Fedora mysql-5.0.15]$ cat /etc/issue
Fedora Core release 1 (Yarrow)
Kernel \r on an \m

[openxs@Fedora mysql-5.0.15]$ gcc --version
gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
...

Our versions are slightly different, but I do not understand how you can get that kind of error. Please, try to compile once more. Do you think it is FC2-specific issue? We have a couple of FC2 development machines around, but they are busy. I'll try to compile on them anly as a last resort.

Do you have any other ideas on what shell I do to repeat the problem you described?
[31 Oct 2005 22:23] Thomas Keller
I've started again from the scratch, extracted from source and did the following:

nice -n 19 ./configure --with-tcp-port=3307 \
--with-mysqld-user=mysql5 \
--with-charset=utf8 \
--with-collation=utf8_general_ci \
--prefix=/opt/mysql5 \
--program-suffix=5

nice -n 19 make 

make clean

nice -n 19 make

(notice that I needed to use all heavy commands with nice because I'm doing this on our production server... well, there is just no other server with equivalent hard/software around and I don't like to kill our webapp =)

Only the second make brings out the previously reported error, the first fails because of "missing files" in /tmp. I first thought this comes through a too little /tmp parition (only 300MB), but I monitored it via df -m and the usage never went over 40%.

I attached the output of the configure and the both makes. I hope this helps you.
[31 Oct 2005 22:25] Thomas Keller
output of the configure command

Attachment: mysql5-configure-output.txt.gz (application/x-gzip, text), 5.67 KiB.

[31 Oct 2005 22:25] Thomas Keller
Output of the first make

Attachment: mysql5-make-output.txt.gz (application/x-gzip, text), 15.28 KiB.

[31 Oct 2005 22:25] Thomas Keller
Output of the second make

Attachment: mysql5-make2-output.txt.gz (application/x-gzip, text), 12.66 KiB.

[1 Nov 2005 7:21] Valeriy Kravchuk
OK. I am forced to try on some FC2 machine. I'll do it and inform you about the results. In any case, it may be just a problem of limited resources on a busy machine.
[3 Nov 2005 16:24] Valeriy Kravchuk
Still was not able to repeat on our FC2 machine with the following commands:

gunzip < mysql-5.0.15.tar.gz | tar xvf -
cd mysql-5.0.15
./configure --with-tcp-port=3307 --with-mysqld-user=mysql5 --with-charset=utf8 --with-collation=utf8_general_ci --prefix=/opt/mysql5 --program-suffix=5
make

-bash-2.05b$ echo $?
0
-bash-2.05b$ uname -a
Linux production.mysql.com 2.6.11-1.14_FC3smp #1 SMP Thu Apr 7 19:38:19 EDT 2005 i686 i686 i386 GNU/Linux
-bash-2.05b$ cat /etc/issue
Fedora Core release 2 (Tettnang)
Kernel \r on an \m

Looks like it is a problem on your machine only.
[3 Nov 2005 16:31] Thomas Keller
Hrm... since I don't know anything about the internals of MySQL, could you please tell me where "thr_find_all_keys", "_create_index_by_sort" and the others are defined so I can check if I have the appropriate library properly installed or built?

Thanks for your time,
Thomas.
[3 Nov 2005 16:36] Thomas Keller
As a sidenote: It doesn't seem as this is a "vanilla" FC2 you have there (your kernel has FC3 in its name and is from the 2.6 line, while Kernel 2.6 was introduced in FC3 first).
I don't know if there are any other, new packages installed on your side, so I'll just give you the output of rpm -qa as attachment.
[3 Nov 2005 16:43] Sinisa Milivojevic
The symbols that you ask about are all in libmyisam.a library.
[4 Nov 2005 16:09] Valeriy Kravchuk
I've got your list of pakages and may come up with some suggestion. In any case, I really can't repeat the problem you described.
[4 Nov 2005 20:20] Thomas Keller
Great, so we can eventually discuss this outside this topic, if its not a bug? I don't know if you can see my email address, so this is it: me at thomaskeller dot biz.

Thanks for your ongoing support,
Thomas.