Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] glibc and mysql 4.1.7

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Benoit PAPILLAULT <benoit.papillault AT sourcemage.org>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] glibc and mysql 4.1.7
  • Date: Thu, 04 Nov 2004 14:45:55 +0100

Laurent Wandrebeck a écrit :
[big snip]

In my opinion the best solution to this is to reverse your change to the
mysql spell and patch glibc to contain the string NPTL in that output.
I'm just glad we didn't integrate that glibc into test yet, it'll break
every spell that has to detect NPTL.
The other solution would be to grep for the new string instead, fixing
it in all spells. Though that would mean we would have to grep for both
strings, as people don't necessarily have the latest glibc snapshot
installed.
Opinions, Suggestions?


Don't you think /lib/libc.so.6 | egrep "(NPTL|Native\ POSIX\ Threads\
Library)" would be much cleaner ?
I don't think we should patch glibc for such a thing. It's up to sorcery
or spells to take care of it.
regards.

I google a bit and found lots of answers to your problem.

First of all, the original problem is that MySQL 4.1.7 does not properly detects and use NPTL. The bug has been reported to MySQL people (see : http://bugs.mysql.com/bug.php?id=2173). No clear patch has been proposed.

However, one things is now clear. MySQL should detect NPTL by itself, not by a way which would be specific to a distro, like SourceMage GNU/Linux. So, all solutions proposing to changed sorcery or every other spell are clearly wrong and would not solve the original problem.

A similar bug has been reported by Debian people (http://bugs.mysql.com/bug.php?id=5871) and this bug report contains a patch against MySQL.

Moreover, the proper way to detect NPTL versus linuxthreads is by checking the result of "getconf GNU_LIBPTHREAD_VERSION" which returns
- "NPTL 0.61" on an NPTL-enabled system
- "linuxthreads-0.10" on a linuxthreads system
getconf is part of the glibc spell itself.

However, the glibc-linuxthreads are buggy (they use ../nptl/Banner instead of ../linuxthreads/Banner) when computing the getconf strings. Debian sources clearly includes the following patch (see attachment)
As a result, the getconf produced on SourceMage system returns an empty strings instead of "linuxthreads", but it works on NPTL-enabled system.

Conclusion:
- add the MySQL patch to the MySQL spell
- add the glibc patch to the glibc spell (if needed)
- do not modify sorcery for such things
- do not modify other spells

Benoit PAPILLAULT, ISO team
+diff -urN -x CVS -x nptl -x nptl_db -x .cvsignore -x '*texi' -x '*manual*' glibc-2.3.2/linuxthreads/sysdeps/pthread/Makefile /home/jbailey/Programming/cvstree/libc
/linuxthreads/sysdeps/pthread/Makefile
+--- glibc-2.3.2/linuxthreads/sysdeps/pthread/Makefile  2003-02-12 16:40:09.000000000 -0500
++++ /home/jbailey/Programming/cvstree/libc/linuxthreads/sysdeps/pthread/Makefile       2003-08-21 08:37:03.000000000 -0400
+@@ -1,5 +1,6 @@
+ ifeq ($(subdir),rt)
+ librt-sysdep_routines += timer_routines
++CPPFLAGS += -DBROKEN_THREAD_SIGNALS
+ 
+ ifeq (yes,$(build-shared))
+ $(objpfx)tst-timer: $(objpfx)librt.so $(shared-thread-library)
+@@ -9,5 +10,5 @@
+ endif
+ 
+ ifeq ($(subdir),posix)
+-CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../nptl/Banner)\""
++CFLAGS-confstr.c += -DLIBPTHREAD_VERSION="\"$(shell sed 's/\(.*\) by .*/\1/' ../linuxthreads/Banner)\""
+ endif



Archive powered by MHonArc 2.6.24.

Top of Page