More debug on mysqld startup magic

More debug on mysqld startup magic

am 21.10.2002 13:38:45 von mmokrejs

Hi,
I should note I use linux i386, mysql from BK (4.0 tree).:

How-To-Repeat:

/usr/local/mysql-BK-20021018$ strace -a -f /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql2 --user=mysql --pid-file=/usr/local/mysql/var/kulan.pid2 --skip-locking --port=3305 --socket=/tmp/mysql2.sock
execve("/usr/local/mysql/libexec/mysqld", ["/usr/local/mysql/libexec/mysqld", "--basedir=/usr/local/mysql", "--datadir=/data/mysql2", "--user=mysql", "--pid-file=/usr/local/mysql/var/kulan.pid2", "--skip-locking", "--port=3305", "--socket=/tmp/mysql2.sock"], [/* 26 vars */]) = 0
fcntl64(0, F_GETFD) = 0
fcntl64(1, F_GETFD) = 0
fcntl64(2, F_GETFD) = 0
uname({sys="Linux", node="kulan", ...}) = 0
geteuid32() = 1001
getuid32() = 1001
getegid32() = 1001
getgid32() = 1001
getrlimit(0x3, 0xbffff560) = 0
setrlimit(RLIMIT_STACK, {rlim_cur=2044*1024, rlim_max=RLIM_INFINITY}) = 0
getpid() = 1875
rt_sigaction(SIGRTMIN, {0x81acf20, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x81acf88, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGRT_2, {0x81ad064, [], 0x4000000}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RTMIN], NULL, 8) = 0
_sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbffff368, 35, (nil), 0}) = 0
brk(0) = 0x82ee4e8
brk(0x82ee518) = 0x82ee518
brk(0x82ef000) = 0x82ef000
open("/etc/localtime", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=837, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
read(3, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\10"..., 4096) = 837
close(3) = 0
munmap(0x40000000, 4096) = 0
time(NULL) = 1035199702
uname({sys="Linux", node="kulan", ...}) = 0
open("/etc/my.cnf", O_RDONLY|O_LARGEFILE) = 3

-------------^ OK, here's read the sitewide config. I've missed this line previously, sorry.

fstat64(3, {st_mode=S_IFREG|0644, st_size=5592, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
read(3, "# Example mysql config file for "..., 4096) = 4096
brk(0x82f0000) = 0x82f0000
read(3, "ing Innobase tables\n#innodb_data"..., 4096) = 1496
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40000000, 4096) = 0
open("/usr/local/mysql/var/my.cnf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/home/users/bioadmin/.my.cnf", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0600, st_size=314, ...}) = 0
[...]
open("mysql-BK-20021018/share/mysql/english/errmsg.sys", O_RDONLY|O_LARGEFILE) = 3
read(3, "\376\376\2\1\1\0\372-\355\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"... , 32) = 32
brk(0x82f6000) = 0x82f6000
read(3, "\0\0\10\0\20\0\23\0\27\0>\0f\0\222\0\302\0\367\0002\1l"..., 474) = 474
read(3, "hashchk\0isamchk\0NO\0YES\0Can\'t cre"..., 11770) = 11770
close(3) = 0
umask(06) = 022
chdir("/data/mysql2/") = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sin_family=AF_INET, sin_port=htons(3305), sin_addr=inet_addr("0.0.0.0")}}, 16) = 0
listen(3, 100) = 0
geteuid32() = 1001
write(2, "Warning: One can only use the --"..., 63Warning: One can only use the --user switch if running as root
) = 63
socket(PF_UNIX, SOCK_STREAM, 0) = 4
unlink("/tmp/mysql2.sock") = -1 ENOENT (No such file or directory)
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
umask(0) = 06
bind(4, {sin_family=AF_UNIX, path="/tmp/mysql2.sock"}, 110) = 0
umask(06) = 0
listen(4, 100) = 0
old_mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a directory)

-------------^ why is mysqld opening /dev/null as a directory?

open("/var/tmp/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 5
fstat64(5, {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
[...]
open("./mysql/host.frm", O_RDONLY|O_LARGEFILE) = -1 EACCES (Permission denied)
time(NULL) = 1035199702
write(2, "021021 13:28:22 ", 17021021 13:28:22 ) = 17
write(2, "Fatal error: Can\'t open privileg"..., 89Fatal error: Can't open privilege tables: Can't find file: './mysql/host.frm' (errno: 13)) = 89
write(2, "\n", 1
) = 1
kill(1877, SIGTERM) = 0
unlink("/usr/local/mysql/var/kulan.pid2") = 0
write(6, "@p+\10\2\0\0\0\1\0\0\0d\363+\10\1\0\0\0\34\371\377\277"..., 148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [HUP QUIT PIPE TERM TSTP RTMIN], 8) = 0
rt_sigsuspend([HUP QUIT PIPE TERM TSTP]
--- SIGRTMIN (Real-time signal 0) ---
<... rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system call)
sigreturn() = ? (mask now [HUP QUIT PIPE TERM TSTP RTMIN])
wait4(1876, NULL, __WCLONE, NULL) = 1876
_exit(1) = ?
/usr/local/mysql-BK-20021018$ ls -la /tmp/mysql2.sock
srwxrwxrwx 1 bioadmin bioadmin 0 Oct 21 13:28 /tmp/mysql2.sock
/usr/local/mysql-BK-20021018$

How about removing the socket file? In this case mysqld really could not read the mysql database
tables containg privileges.


The messages above use just to locate the possible position in the source code.
I hope this helps to improve the quality.

--
Martin Mokrejs ,
PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3683 , fax: +49-89-3187 3585


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12812@lists.mysql.com
To unsubscribe, e-mail

More debug on mysqld startup magic

am 11.11.2002 15:36:58 von Michael Widenius

Hi!

>>>>> "Martin" == Martin MOKREJ writes:

Martin> Hi,
Martin> I should note I use linux i386, mysql from BK (4.0 tree).:

Martin> How-To-Repeat:



Martin> setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
Martin> umask(0) = 06
Martin> bind(4, {sin_family=AF_UNIX, path="/tmp/mysql2.sock"}, 110) = 0
Martin> umask(06) = 0
Martin> listen(4, 100) = 0
Martin> old_mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
Martin> open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a directory)

Martin> -------------^ why is mysqld opening /dev/null as a directory?

MySQL doesn't open this file directly, but this is done by some
library calls (probably by the socket handling code)



Martin> _exit(1) = ?
Martin> /usr/local/mysql-BK-20021018$ ls -la /tmp/mysql2.sock
Martin> srwxrwxrwx 1 bioadmin bioadmin 0 Oct 21 13:28 /tmp/mysql2.sock
Martin> /usr/local/mysql-BK-20021018$

Martin> How about removing the socket file? In this case mysqld really
could not read the mysql database tables containg privileges.

Yes, this is a bug. I will fix this for next release

Martin> The messages above use just to locate the possible position in the source code.
Martin> I hope this helps to improve the quality.

Yes, this did pinpoint a couple of problem cases.
Thanks!

Regards,
Monty

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12954@lists.mysql.com
To unsubscribe, e-mail