Bug #972 MySQL does not compile with or support NPTL
Submitted: 31 Jul 2003 20:40 Modified: 1 Aug 2003 4:45
Reporter: Robin Johnson Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:4.0.14 OS:Linux (Gentoo Linux 1.4)
Assigned to: CPU Architecture:Any

[31 Jul 2003 20:40] Robin Johnson
Description:
On a 2.[56] kernel with Glibc compiled for NPTL, MySQL's configure does not complete.

Output:
checking for int8... no
checking "LinuxThreads"... "Not found"
configure: error: This is a linux system and Linuxthreads was not
found. On linux Linuxthreads should be used.  Please install Linuxthreads
(or a new glibc) and try again.  See the Installation chapter in the
Reference Manual for more information.

How to repeat:
Have a box with a 2.[56] kernel and NPTL support in glibc, then try to run the configure script.
[1 Aug 2003 4:45] Alexander Keremidarski
NPTL is still work in progress so we don't pay much attention on it. When it stabilizes enough AND there is some standartized environment for NPTL then there will be reason to concentrate on it.

MySQL does compile without problems against RedHat9 NPTL libraries. From our experience we can tell it works stable enough. However this is Distribution specific.

As you know we provide only general instructions on how to compile MySQL under Linux. It is impossible to do it for every Linux flavour

You can try building MySQL with configure option:

  --with-named-thread-libs=ARG
                          Use specified thread libraries instead of
                          those automatically found by configure.
[11 Sep 2003 8:09] elaine forbes
I've tried this

./configure --prefix=/usr --disable-dependency-tracking --without-bench --without-debug --enable-assembler --localstatedir=/var/lib/mysql --mandir=/usr/share/man --with-extra-charset=all --with-pthread --with-named-thread-libs=-lpthread

Working against  gcc v 3.2.3, 3.3, 3.3.1 and the 3.4/cvs needed to compile glibc+nptl and mysql 4.0.14, 4.1-alpha and 5.0-bk

All cases however, give:

gcc -DMAP_TO_USE_RAID -I. -I. -I.. -I./../include -I../include    -O3 -DDBUG_OFF   -c `test -f mi_open.c || echo './'`mi_open.c
In file included from fulltext.h:21,
                 from mi_open.c:19:
myisamdef.h:206: error: syntax error before "pthread_rwlock_t"
myisamdef.h:206: warning: no semicolon at end of struct or union
myisamdef.h:208: warning: data definition has no type or storage class

--with-named-thread-libs=-lpthread removes  #define HAVE_LINUXTHREADS
from my_config.h and the function prototypes of NPTL seem to be different.

Any suggestions on how to work around this will be appreciated
[12 Sep 2003 6:14] Michael Waiblinger
I found the following in the gentoo forum: 
http://forums.gentoo.org/viewtopic.php?p=285261#285261

> To get MySQL to compile against the new glibc, you need to add the following
> line to /usr/include/pthread.h:
>   /* Linuxthreads */

I try it right now but the mentioned error which also ocurred to me with mysql 4.0.13 seems to be fixed. (I also tried the configure of 4.0.14 without a prob)
[12 Sep 2003 11:02] elaine forbes
Interesting .. /* Linuxthreads */ worked as for compile and on the ++side 
initial testing suggests that it's more stable I've found running mysql built on linuxthreads but running on nptl.

The downside would seem to be that performance has taken a big hit. When I put
apache+mysql under a 500 client load mysql's memory use climbs to 70MB (500+ virtual and seems to never come back down.

    871 mysql     23   0  538m  71m 5672 R  5.9 28.6   0:30.22 mysqld  

Admittedly my prior testing was using mysql 3 which might be lighter weight? But my guess is that execution threads are not being reaped.

According to 'top' it's pretty heavy just getting started/no clients

                      VIRT  res
790 mysql     15   0  144m  18m 5672 S  0.0  7.5   0:00.16 mysqld                                    

I'll give this a go with mysql 3 next