Bug #59074 mysql-5.5.8 won't start with libnss-mysql enabled
Submitted: 20 Dec 2010 23:01 Modified: 26 May 2012 20:11
Reporter: John Wall Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Errors Severity:S2 (Serious)
Version:5.5.8 OS:Linux (Ubuntu 10.10 server)
Assigned to: CPU Architecture:Any
Tags: libnss-mysql error

[20 Dec 2010 23:01] John Wall
Description:
Hi,

Im trying to install a clean 5.5.8 install on my system wich use libnss-mysql wich fail whatever i do. I have however installed mysql-5.5.8-linux2.6-x86_64 on my labserver and works perfect without libnss-mysql. 

Doing a fresh install with:

./mysql_install_db --basedir=/export/tools/mysql --datadir=/export/db

I change the path's in mysql.server so they fits with above. When i try to start the server i get the following error:

101220 22:45:38 mysqld_safe Starting mysqld daemon with databases from /export/db
101220 22:45:38 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=0
read_buffer_size=2097152
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 620212 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = (nil) thread_stack 0x40000
/export/tools/mysql/bin/mysqld(my_print_stacktrace+0x39)[0x916839]
/export/tools/mysql/bin/mysqld(handle_segfault+0x359)[0x4fc0d9]
/lib/libpthread.so.0(+0xfb40)[0x7f4702af8b40]
/export/tools/mysql/bin/mysqld(thd_increment_bytes_received+0x1a)[0x54b07a]
/export/tools/mysql/bin/mysqld[0x506a55]
/export/tools/mysql/bin/mysqld(my_net_read+0x1a4)[0x506e34]
/export/tools/mysql/bin/mysqld(cli_safe_read+0x2a)[0x648a9a]
/export/tools/mysql/bin/mysqld(mysql_real_connect+0x358)[0x64a968]
/usr/lib/libnss_mysql.so.2(_nss_mysql_db_connect+0x2c8)[0x7f4700a45e68]
/usr/lib/libnss_mysql.so.2(_nss_mysql_setent+0x1fc)[0x7f4700a4876c]
/lib/libc.so.6(+0xa69c8)[0x7f4701f449c8]
/lib/libc.so.6(+0xa6e8d)[0x7f4701f44e8d]
/lib/libc.so.6(initgroups+0x63)[0x7f4701f44f93]
/export/tools/mysql/bin/mysqld[0x50198b]
/export/tools/mysql/bin/mysqld(_Z11mysqld_mainiPPc+0xdaf)[0x50512f]
/lib/libc.so.6(__libc_start_main+0xfe)[0x7f4701ebcd8e]
/export/tools/mysql/bin/mysqld[0x4fa3fa]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

This crash occured while the server was calling initgroups(). This is
often due to the use of a mysqld that is statically linked against glibc
and configured to use LDAP in /etc/nsswitch.conf. You will need to either
upgrade to a version of glibc that does not have this problem (2.3.4 or
later when used with nscd), disable LDAP in your nsswitch.conf, or use a
mysqld that is not statically linked.

mysqlversion: mysql-5.5.8-linux2.6-x86_64
OS: Ubuntu 10.10 Server
libnss-mysql: libnss-mysql 1.0-4build1

How to repeat:
Install libnss-mysql and try to start mysql-5.5.8

put mysql in /etc/nsswitch.conf

passwd:         compat mysql
group:          compat mysql
shadow:         compat mysql

Suggested fix:
Temporary fix is to disable mysql in nsswitch.conf:

change from:

passwd:         compat mysql
group:          compat mysql
shadow:         compat mysql

To:

passwd:         compat 
group:          compat 
shadow:         compat
[21 Dec 2010 16:57] Sveta Smirnova
Thank you for the report.

There is listed limitation in libnss-mysql documentation at http://libnss-mysql.sourceforge.net/libnss-mysql/README: "Supported MySQL Versions:    o MySQL 3.23.9 - 4.1.x" Why do you think this is MySQL 5.5.8 bug?
[31 Dec 2010 11:17] John Wall
Hi there,

Why i think its a bug is cause i get this error on the clients and not on the servers, ive been trying alot of different linuxes now with the same problem. Our server runs a supported MySQL. 

What i dont get is that mysql seems to depend on the info in nsswitch.conf on the clients. As i wrote before, if i remove mysql in nsswitch.conf everything working fine. I dont get why that have something to do with mysql in general ?
[31 Dec 2010 12:05] Sveta Smirnova
Thank you for the feedback.

You wrote: "What i dont get is that mysql seems to depend on the info in nsswitch.conf on the
clients.", but error you provided is actually happens on server:

101220 22:45:38 mysqld_safe Starting mysqld daemon with databases from /export/db
101220 22:45:38 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary

How can it be so?

Also you don't follow order installation instructions of libnss:

    o Add data to MySQL. The default configs will work well with the sample
      sql database in sample/sample_database.sql.  Read that file for more
      details on the sample database.

    o Edit (or create) /etc/nsswitch.conf such that it contains at least the
      following:
        passwd: files mysql
        shadow: files mysql
        group:  files mysql

Please do it as described: remove mysql from /etc/nsswitch.conf, start mysqld, add libnss data to MySQL server, then add mysql to /etc/nsswitch.conf and restart MySQL server. Please inform us if problem still exists.
[1 Jan 2011 18:53] John Wall
ok, lets take it from the start.

libnss-mysql is used like ldap but agains a mysqlserver, every server and client uses libnss-mysql to authenticate agains a mysql-server(5.1.53). Our authentication-server runs mysql 5.1.53 and works like a charm, BUT the problem here is that i want to run mysql-server 5.5.8 on a client-server not the libnss-mysql server itself. So what im trying to explain here is that our authentication-server have nothing to do with the client-server that im trying to install mysql-5.5.8 on. This is what i dont get, nsswitch.conf is just used for authentication of local users, why does mysql 5.5.8 depends on nsswitch.conf ?
[2 Jan 2011 1:19] Elodie BOSSIER
Greetings,

I have the same problem with libnss-mysql 1.5 (2005) and MySQLd 5.5.8 (2010). 

When i try to start MySQL i have this error :
Inconsistency detected by ld.so: dl-open.c: 612: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!

or when i try to start a new SSH window, it's impossible, with a ssh restart it's same.

When i take off mysql from nsswitch.conf it's works.

I need to much libnss-mysql and without it i can't continue my business. Do you have an idea please ?
[2 Jan 2011 1:20] Elodie BOSSIER
PS. I works with Slackware 64 bits.
[26 Apr 2012 20:11] Sveta Smirnova
Thank you for the feedback.

I can not repeat this behavior with current development version. Could you please try with current GA version 5.5.22 and inform us if problem still exists?
[27 May 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".