Bug #16213 mysql client segfaults
Submitted: 5 Jan 2006 7:58 Modified: 6 Feb 2006 14:26
Reporter: Lenz Grimmer Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0 OS:Linux (SUSE Linux 9.0)
Assigned to: CPU Architecture:Any

[5 Jan 2006 7:58] Lenz Grimmer
Description:
(This was taken from the forums at http://forums.mysql.com/read.php?11,55591,55591#msg-55591)

We are running SuSE 9.0 successfully with MySQL 4.1 (mysql.org's RPM's). When upgrading to MySQL 5.0 everything goes ok and the MySQL server starts up without issue.

If we connect via the mysql command line client it connects but consistanly exits with a segmentation fault error message. This can always be reproduced by typing a valid SQL query, then hitting the up arrow on the keyboard to cycle the previous SQL commands in the history. eg: (commentary given as {ED: })

----------------
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.15-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
{ED: db listing given}
mysql> {ED: up arrow hit}
mysql> show databases;
mysql> {ED: up arrow hit}
Segmentation fault
{ED: client exits}
----------------

There is no output given in error logs and the strace output below is meaningless to us.

----------------
write(1, "mysql> ", 7mysql> ) = 7
read(0, "\33", 1) = 1
read(0, "[", 1) = 1
read(0, "A", 1) = 1
write(1, "show databases;", 15show databases;) = 15
read(0, "\33", 1) = 1
read(0, "[", 1) = 1
read(0, "A", 1) = 1
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=21436, ...}) = 0
old_mmap(NULL, 21436, PROT_READ, MAP_SHARED, 4, 0) = 0x4002d000
close(4) = 0
open("/usr/lib/gconv/ISO8859-1.so", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\6\0\000"..., 1024) = 1024
fstat64(4, {st_mode=S_IFREG|0755, st_size=6052, ...}) = 0
old_mmap(NULL, 8860, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40033000
mprotect(0x40035000, 668, PROT_NONE) = 0
old_mmap(0x40035000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x1000) = 0x40035000
close(4) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=24127, ...}) = 0
old_mmap(NULL, 24127, PROT_READ, MAP_PRIVATE, 4, 0) = 0x40036000
close(4) = 0
open("/lib/libc.so.6", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0^\1\000"..., 1024) = 1024
fstat64(4, {st_mode=S_IFREG|0755, st_size=1470060, ...}) = 0
old_mmap(NULL, 1269380, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x4003c000
mprotect(0x4016b000, 28292, PROT_NONE) = 0
old_mmap(0x4016b000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x12e000) = 0x4016b000
old_mmap(0x40170000, 7812, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40170000
close(4) = 0
open("/lib/ld-linux.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\n\0\000"..., 1024) = 1024
fstat64(4, {st_mode=S_IFREG|0755, st_size=101556, ...}) = 0
old_mmap(NULL, 88440, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x40172000
mprotect(0x40187000, 2424, PROT_NONE) = 0
old_mmap(0x40187000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0x15000) = 0x40187000
close(4) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
----------------

Note: The mysql client program will also segment fault randomly when excuting other SQL commands, but the above always produces the same outcome.

Accessing MySQL via a PHP web application queries the database successfully without any apparent error. 

How to repeat:
Follow the procedure outlined above, observe the client to crash.
[6 Jan 2006 1:04] KB Intl
Update: We worked around this issue by compiling from source tarball and have MySQL 5.0  running successfully.
[6 Jan 2006 14:26] Valeriy Kravchuk
Looks like a duplicate of bug #14503 for me. What exact 5.0.x version was used?
[7 Feb 2006 0: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".