Bug #3919 | mysqld crashes after update to 4.0.20 | ||
---|---|---|---|
Submitted: | 27 May 2004 18:11 | Modified: | 28 May 2004 10:30 |
Reporter: | Dimitrij HIlt | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.0.20-standard-log | OS: | Linux (Linux x86) |
Assigned to: | Marko Mäkelä | CPU Architecture: | Any |
[27 May 2004 18:11]
Dimitrij HIlt
[27 May 2004 21:56]
Sergei Golubchik
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to 'Open'. Thank you for your interest in MySQL. Additional info: what is the query that causes a crash ?
[28 May 2004 0:34]
Dimitrij HIlt
Hi, it seems to be same bug such as 3596. I got same backtrace: 0x80720d4 handle_segfault + 420 0x8250d48 pthread_sighandler + 184 0x8272e9e ftell + 14 0x80f87c2 srv_printf_innodb_monitor + 818 0x80f8ce0 srv_lock_timeout_and_monitor_thread + 512 0x824e4fc pthread_start_thread + 220 0x828452a thread_start + 4 Regards, Dimitrij Hilt
[28 May 2004 0:35]
Dimitrij HIlt
Additional info: mysqld die without any query Dimitrij Hilt
[28 May 2004 8:40]
Heikki Tuuri
Hi! I guess the call of tmpfile() fails in dict0dict.c. Workaround: check that the directory /tmp exists in the computer, and check that the disk is not full, and that the user running mysqld has full access rights to that directory, so that mysqld can create a temporary file there. Marko should add diagnostics to: heikki@hundin:~/mysql-4.0prod/innobase> grep -n tmpfile ./*/*.c ./dict/dict0dict.c:645: dict_foreign_err_file = tmpfile(); ./lock/lock0lock.c:513: lock_latest_err_file = tmpfile(); or even better, make a new function os_file_create_tmpfile() and put diagnostics there. Thank you for the bug report! Heikki TMPFILE(3) Linux Programmer's Manual TMPFILE(3) NAME tmpfile - create a temporary file SYNOPSIS #include <stdio.h> FILE *tmpfile (void); DESCRIPTION The tmpfile() function generates a unique temporary file name. The temporary file is then opened in binary read/write (w+b) mode. The file will be automatically deleted when it is closed or the program terminates nor mally. RETURN VALUE The tmpfile() function returns a stream descriptor, or NULL if a unique filename cannot be generated or the unique file cannot be opened. In the latter case, errno is set to indicate the error. ERRORS EACCES Search permission denied for directory in file's path prefix. EEXIST Unable to generate a unique filename. EMFILE Too many file descriptors in use by the process. ENFILE Too many files open in the system. ENOSPC There was no room in the directory to add the new filename. EROFS Read-only filesystem. EINTR The call was interrupted by a signal. CONFORMING TO SVID 3, POSIX, BSD 4.3, ISO 9899, SUSv2 NOTES An error message may be written to stdout if the stream cannot be opened. The standard does not specify the directory that tmpfile() will use. Glibc will try the path prefix P_tmpdir defined in <stdio.h>, and if that fails the directory /tmp. SEE ALSO exit(3), mktemp(3), mkstemp(3), tmpnam(3), tempnam(3)
[28 May 2004 8:47]
Heikki Tuuri
Hi! By the way, Marko should add diagnostics to all the cases where writing to those tmpfiles, or to the file innodb.status.xxxx, fails because the disk is full or for some other reason. Maybe we should at the mysqld startup create a fixed-size innodb.status.xxxxx and fixed-size innodb_foreign_key_err and innodb_deadlock_err files, so that it would be less probable that writing will fail because of a full disk. Regards, Heikki
[28 May 2004 8:53]
Heikki Tuuri
Hi! Actually, maybe we should remove the call of tmpfile() and create those files to the datadir, like the innodb.status file? Then we do not need to assume anything about the mysqld access rights to /tmp. Regards, Heikki
[28 May 2004 9:46]
Dimitrij HIlt
Thanks to Heikki, chmod 1777 /tmp resolv this problem. But 'signal 11'?! Dimitrij Hilt
[28 May 2004 10:30]
Marko Mäkelä
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: Like Heikki wrote, there were two unsafe calls to tmpfile(), invoked at server start-up. I added a diagnostics message. I don't think that it is a good idea to create these two files in datadir, because on some systems, /tmp resides in virtual memory (such as Linux shm fs) and may thus be faster than datadir.