9 messages in com.mysql.lists.bugsRe: crashing: /proc/613/exe: Permissi...
FromSent OnAttachments
Martin MOKREJŠ18 Oct 2002 04:36 
Michael Widenius20 Oct 2002 10:03 
Martin MOKREJŠ21 Oct 2002 04:03 
Martin MOKREJŠ04 Nov 2002 06:23 
Michael Widenius11 Nov 2002 05:53 
Michael Widenius11 Nov 2002 07:52 
Martin MOKREJŠ20 Nov 2002 08:25 
Martin MOKREJŠ18 Dec 2002 02:26 
Martin MOKREJŠ07 Jan 2003 07:30 
Subject:Re: crashing: /proc/613/exe: Permission denied
From:Michael Widenius (mon@mysql.com)
Date:11/11/2002 07:52:04 AM
List:com.mysql.lists.bugs

Hi!

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

Martin> On Sun, 20 Oct 2002, Michael Widenius wrote: Martin> Hi Michael,

MW> Martin> How-To-Repeat: MW> MW> Martin> 021018 13:19:33 mysqld started MW> Martin> crashing: /proc/613/exe: Permission denied MW> Martin> BFD load failed..

<cut>

Martin> /scratch/mysql-4.0# gdb ./sql/mysqld <cut> Martin> start_signal_handler () at mysqld.cc:1498 Martin> 1498 if
((error=pthread_create(&signal_thread,&thr_attr,signal_hand,0))) Martin> Current language: auto; currently c++ Martin> (gdb) Martin> 1504 (void)
pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); Martin> (gdb) crashing: /proc/21712/exe: Permission denied Martin> BFD load failed..

The above means that either something is wrong with your pthread_cond_wait() call or that because of some strange reason the signal handler died.

You could try to verify this by setting a break point at 'signal_hand' and single step through this code.

<cut>

MW> Martin> BTW: Inspecting the trace log tells me, there are a lost of PATH's MW> Martin> hardcoded into binaries, and very often it tries to open ./anything
before MW> Martin> using $BINDIR/anything or using similar variable set by mysqld_safe.
Is MW> Martin> that expected? MW> MW> Can you give us some examples of this ? MW> Especially when searching after my.cnf files mysqld will try some MW> pre-determinate paths, but appart from that this shouldn't happen.

Martin> OK, something a bit different what I meant previously, but let's think
of this:

Martin> [pid 21262] open("./mysql/func.frm", O_RDONLY|O_LARGEFILE) = 7 Martin> [pid 21262] read(7,
"\376\1\7\t\3\0\0\20\1\0\0000\0\0\347\0\303\0\0\0\0\0\0"..., 64) = 64 Martin> [pid 21262] _llseek(7, 64, [64], SEEK_SET) = 0 Martin> [pid 21262] read(7, "//\0\0 \0\0", 7) = 7 Martin> [pid 21262] _llseek(7, 4096, [4096], SEEK_SET) = 0 Martin> [pid 21262] read(7,
"\1\1\23\0\n\0\2@\0\1\1\200\2\0\0\0\0@\0\377PRIMARY\377"..., 30) = 30 Martin> [pid 21262] pread(7, "\377 "..., 195,
4327) = 195 Martin> [pid 21262] _llseek(7, 8192, [8192], SEEK_SET) = 0 Martin> [pid 21262] read(7,
"\301\1\0\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 288) = 288 Martin> [pid 21262] read(7, "M\0\5\4\2\24) "..., 161) =
161 Martin> [pid 21262] close(7) = 0 Martin> [pid 21262] getcwd("/data/mysql2", 4096) = 13

Martin> --------------------^ we do getcwd() foreach mysql.* table, although it
seems we already are Martin> in $datadir.

MySQL has to call 'getwcd()' to be able to resolve the name to an absolute path (needed for the internal locking handling).

MySQL will cache the result from getwcd() for future calls, so this isn't that bad.

Martin> [pid 21262] readlink("./mysql/func.MYD", 0xbfffe84c, 511) = -1 EINVAL
(Invalid argument)

Martin> ---------------------------------------------------------------^ ?

The above is ok, as func.MYD is not a symbolic link.

<cut>

MW> Martin> But those are probably only of interrest until my.cnf is found. MW> MW> Actually you should not get any errors like the above if mysqld fines MW> a my.cnf file as my.cnf files are searched for first. After this MW> mysqld should use the paths from the my.cnf file instead of any MW> internal paths.

Martin> open("/etc/my.cnf", O_RDONLY|O_LARGEFILE) = 3 Martin> fstat64(3, {st_dev=makedev(8, 1), st_ino=104, st_mode=S_IFREG|0644,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=16, st_size=5592,
st_atime=2002/11/04-14:30:06, st_mtime=2002/08/30-14:56:28,
st_ctime=2002/08/30-14:56:28}) = 0 Martin> old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40000000 Martin> read(3, "# Example mysql config file for "..., 4096) = 4096 Martin> read(3, "ing Innobase tables\n#innodb_data"..., 4096) = 1496 Martin> read(3, "", 4096) = 0 Martin> close(3) = 0 Martin> munmap(0x40000000, 4096) = 0 Martin> open("/usr/local/mysql/var/my.cnf", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory) Martin> open("/root/.my.cnf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or
directory)

Martin> Shouldn't we be more paranoid at least about the file permission on
these configfiles? Martin> We read just anything, even world writable and owned by nobody. ;)

For the clients this is ok, as one can anyway change all values in the ~/my.cnf file.

I don't see any reason to slow down things by adding extra checks for the defaults file; Most programs that read option files does the same.

Martin> stat64("/usr/local/mysql-BK20021104/share/mysql/charsets/latin5.conf",
{st_dev=makedev(8, 4), st_ino=81346, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0,
st_gid=50, st_blksize=4096, st_blocks=16, st_size=4545,
st_atime=2002/11/04-14:21:59, st_mtime=2002/11/04-14:21:59,
st_ctime=2002/11/04-14:21:59}) = 0 Martin> sched_setscheduler(0x530e, 0, 0xbffffaf8) = -1 EINVAL (Invalid argument)

Martin> ----------------------------------------------------^ ?

The above is ok and just means that you didn't configure MySQL with support for the above language.

As MySQL does however allow you to add this support later, by just copying the file in place, MySQL has to check this on startup to know if the language is supported or not.

Regards, Monty