Bug #14503 mysql client gives error message with "Segmentation fault"
Submitted: 31 Oct 2005 9:11 Modified: 17 Dec 2005 11:44
Reporter: Nizamettin OZPOLAT Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version: 5.0.15-max-log OS: SuSE Linux 9.0 (i586)
Assigned to: CPU Architecture:Any

[31 Oct 2005 9:11] Nizamettin OZPOLAT
Description:
I start mysql client from shell. So when I press up arrow to rerun previous sql it give this message and returns to linux shell. Here is the screen.

linux:/home/nizam # mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 5.0.15-max-log

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

mysql> select * from OGR_KAYIT_BILGI limit 0,6;Segmentation fault
linux:/home/nizam #

msyq 4.1.* was installed before this computer. I uninstalled this version with YaST and installed mysql 5.0.15 using YaST again. I did not touched any databases. Server runs properly so far but client has problem. I connected to this server from windows client and did not get any error everything looks fine. But linux client has problem.

How to repeat:
I installed 5.0.15 to another machine like this, using the same way as I told before I get the error message again
[31 Oct 2005 9:50] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I can not repeat the behaviour you described with 5.0.16-BK build. mysql client simply works, and pressing up arrow gives me a previous command.

Can you, please, try once more and inform about the results? Have you pressed Enter immediately after up arrow?

May be, your ~/.mysql_history file is corrupted somehow. Please, try to delete it (copy to the other filename before that) and run mysql client once more. Execute a couple of commands, then exit, run mysql and repeat your test again. Inform about the results.
[31 Oct 2005 12:16] Nizamettin OZPOLAT
I have changed the history file as you described but nothing differs. 
Let me describe the problem more closely: I start mysql-client hit the up arrow the command comes and runs properly but when hitting second time it gives the error and returns to shell. The screen as follows, the sql command shown there is the first command comes after first hit to the key.

linux:~ # mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 149 to server version: 5.0.15-max-log

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

mysql> show variables like '%ver%';Segmentation fault
linux:~ # 

And also after first hitting the up arrow key then command comes, when I try to delete any character but not the last character, hitting delete or back space keys again the error comes. 

mysql> show variables like '%verSegmentation fault
linux:~ #

when writing sql, going back with left arrow key and trying to write any characrer also gives error.

All those problem may occur because of the method I followed which I explained below. 

Thank you and best wishes.
[31 Oct 2005 12:51] Valeriy Kravchuk
Please, send the list of (all or, at least, mysql) packages you have installed now. It looks like readline may be broken somehow.

Can you try to download and install RPMs or .tar.gz provided by MySQL manually (see http://dev.mysql.com/downloads/mysql/5.0.html)? Can you try to compile from sources?
[31 Oct 2005 13:29] Nizamettin OZPOLAT
The installed mysql packages are 
MySQL-server 5.0.15-0, 
MySQL-max 5.0.15-0 and 
MySQL-Client 5.0.15-0.

And I have downloaded rmp files from www.mysql.com and installed using YaST.
If needed I can try tar.gz file but it will be more difficult I think.

No more package installed after mysql 4.1.* installation and it used to work properly.
[3 Nov 2005 12:25] Valeriy Kravchuk
I've tried to compile .tar.gz on SLES 9, and was not able to repeat the problem you described with this compiled version. I performed the following steps:

gunzip < mysql-5.0.15.tar.gz | tar -xvf -
cd mysql-5.0.15/
./configure --prefix=/users/vkravchuk/dbs/5.0-sles9 --enable-thread-safe-client --with-innodb
make
make install
cd ~/dbs/5.0-sles9/
bin/mysql_install_db
bin/mysqld_safe --skip-networking --socket=/users/vkravchuk/mysql5.sock &

And then:

vkravchuk@sles9-x86:~/dbs/5.0-sles9> bin/mysql -uroot --socket=/users/vkravchuk/mysql5.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.15

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

mysql> show variables like '%ver%';
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| character_set_server    | latin1              |
| collation_server        | latin1_swedish_ci   |
| innodb_force_recovery   | 0                   |
| myisam_recover_options  | OFF                 |
| protocol_version        | 10                  |
| rpl_recovery_rank       | 0                   |
| server_id               | 0                   |
| version                 | 5.0.15              |
| version_comment         | Source distribution |
| version_compile_machine | i686                |
| version_compile_os      | pc-linux-gnu        |
+-------------------------+---------------------+
11 rows in set (0.00 sec)

Here I pressed arrow up, and:

mysql> show variables like '%ver%';
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| character_set_server    | latin1              |
| collation_server        | latin1_swedish_ci   |
| innodb_force_recovery   | 0                   |
| myisam_recover_options  | OFF                 |
| protocol_version        | 10                  |
| rpl_recovery_rank       | 0                   |
| server_id               | 0                   |
| version                 | 5.0.15              |
| version_comment         | Source distribution |
| version_compile_machine | i686                |
| version_compile_os      | pc-linux-gnu        |
+-------------------------+---------------------+
11 rows in set (0.00 sec)

And once more

mysql> show variables like '%ver%';
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| character_set_server    | latin1              |
| collation_server        | latin1_swedish_ci   |
| innodb_force_recovery   | 0                   |
| myisam_recover_options  | OFF                 |
| protocol_version        | 10                  |
| rpl_recovery_rank       | 0                   |
| server_id               | 0                   |
| version                 | 5.0.15              |
| version_comment         | Source distribution |
| version_compile_machine | i686                |
| version_compile_os      | pc-linux-gnu        |
+-------------------------+---------------------+
11 rows in set (0.00 sec)

Then I deleted some characters from the command obtained as a result of "arrow up":

mysql> show varables like 'ver%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varables like 'ver%'' at line 1
mysql> show variables like 'ver%';
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| version                 | 5.0.15              |
| version_comment         | Source distribution |
| version_compile_machine | i686                |
| version_compile_os      | pc-linux-gnu        |
+-------------------------+---------------------+
4 rows in set (0.00 sec)

So, it just works for me this way on the following platform:

vkravchuk@sles9-x86:~/dbs/5.0-sles9> uname -a
Linux sles9-x86 2.6.5-7.139-smp #1 SMP Fri Jan 14 15:41:33 UTC 2005 i686 i686 i386 GNU/Linux

Would you, please, try to compile from sources? This way we'll be able to check, if it you particular machine-related problem or packaging bug etc. Please, inform about the results.
[7 Nov 2005 9:12] Nizamettin OZPOLAT
I have tried to compile .tar.gz file but could not manage to run, I have run into problems. I always use RMP files to install on linux. So for this version of mysql I also use RMP files. So, can you please test the problem with RPM files? 
(To use source files to install and uninstall is not so much easy).
[8 Nov 2005 12:36] Nizamettin OZPOLAT
Now I've installed MySQL-client-4.1.14-0.i386.rpm and it works properly. What are the differences between 4.1.14 and 5.0.15? 
Client 4.1.14 server 5.0.15, can this be a problem in the future?
[9 Nov 2005 11:28] Valeriy Kravchuk
If you are not suppose to use new 5.0 features (like stored procedures and triggers), 4.1.x client is OK. Otherwise, 5.0.x client is needed.

Would you, please, try to upgrade to 5.0.15 now, having a working 4.1.x installation? Please, inform about the results.
[10 Nov 2005 8:11] Nizamettin OZPOLAT
If I understood you correctly, mysql_client 4.1.14 was intalled on and I have installed mysql-client 5.0.15. So nothing has changed. 4.1.14 uninstalled and 5.0.15 intalled. "upgrade to 5.0.15 now, having a working 4.1.x installation?" I understand from this sentence that upgrade mysql_client 4.1.14 to 5.0.15 but I could not find anything about upgrading clients. 
   If the subject is server, server has no problem it works properly as expected. Infact I also installed windows vesion of 5.0.15 and it also works properly. And With windows client I have connected to linux server 5.0.15 and it worked very nicely, no problem.
[13 Nov 2005 11:44] Valeriy Kravchuk
Yas, what I asked you to do is to upgrade client to 5.0.15 (rpm -U MySQL-client-5.0.15-0.*) after you checked that 4.1.x client worked OK for you. And then try to repeat the same bug with pressing arrow up etc. If that is what you already done, just confirm.
[14 Nov 2005 8:30] Nizamettin OZPOLAT
linux:~/Desktop # rpm -U MySQL-client-5.0.15-0.i386.rpm
warning: MySQL-client-5.0.15-0.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5

I have done what you said and the result is above. It has given a warning as you see but unfortunately the problem stil goes on. As I mentioned before, MySQL-Client 4.1.14 works peroperly.
[14 Nov 2005 9:27] Valeriy Kravchuk
I've just upgraded my 4.0.26 client the same way as you (the warning you got is OK, by the way). Still can't repeat:

[root@Fedora tmp]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 5.0.15-standard

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

mysql> use mysql; -- I used arrow up to get this last command
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> use test; -- I used arrow up and then editied database name
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> exit
Bye
[root@Fedora tmp]# mysql -V
mysql  Ver 14.12 Distrib 5.0.15, for pc-linux-gnu (i686) using readline 5.0
[root@Fedora tmp]# rpm -q -a | grep MySQL
MySQL-server-5.0.15-0.glibc23
MySQL-client-5.0.15-0

So, it can be either a problem of your particular machine, or of SuSE Linux 9.0 only.
[14 Nov 2005 10:58] Nizamettin OZPOLAT
is the machine you test not SuSE Linux 9.0? I thought you test this on the same configuration.
[14 Nov 2005 11:51] Valeriy Kravchuk
Yes, my machine is NOT SuSE 9.0, and I have no root access to SuSE 9.0 right now. That is the only reasond why I had written:

"So, it can be either a problem of your particular machine, or of SuSE
Linux 9.0 only."

and not simply mark this report as can't repeat. Let it wait for somebody with SuSE 9.0 to check once more.
[20 Nov 2005 7:47] Keunhwan Park
I got exactly same error.

Machine is red-hat linux 9.0 based.

MySQL version is 5.0.15-standard.

Installed by using RPM.(maybe it can cause problem.)

----

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

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

mysql> show variables like '%ver%';
+-------------------------+------------------------------------------+
| Variable_name           | Value                                    |
+-------------------------+------------------------------------------+
| character_set_server    | latin1                                   |
| collation_server        | latin1_swedish_ci                        |
| innodb_force_recovery   | 0                                        |
| myisam_recover_options  | OFF                                      |
| protocol_version        | 10                                       |
| rpl_recovery_rank       | 0                                        |
| server_id               | 0                                        |
| version                 | 5.0.15-standard                          |
| version_comment         | MySQL Community Edition - Standard (GPL) |
| version_compile_machine | i686                                     |
| version_compile_os      | pc-linux-gnu                             |
+-------------------------+------------------------------------------+
11 rows in set (0.00 sec)

mysql> show variables like '%ver%';Segmentation fault
[20 Nov 2005 8:04] Keunhwan Park
more information.

MySQL-devel-5.0.15-0
MySQL-client-5.0.15-0
MySQL-server-5.0.15-0
MySQL-shared-compat-5.0.15-0
MySQL-shared-5.0.15-0
[22 Nov 2005 8:06] Nizamettin OZPOLAT
Keunhwan Park also reported the same problem with different linux. Will you repeat the problem with either of the systems?
[1 Dec 2005 0:04] MySQL Verification Team
Could you please take a look to bug:

http://bugs.mysql.com/bug.php?id=15328

if you have an invalid varaible option on your my.cnf.

I was unable to repeat the issue on Suse 10.
[1 Dec 2005 9:17] Nizamettin OZPOLAT
I have made my-small.cnf my.cnf and uncommented innoDB part and then coppied to /etc/ but this is not solution unfortunately. I don't think that my-small.cnf has invalid variable.
[16 Dec 2005 8:38] Valeriy Kravchuk
Can you, please, try to install 5.0.16 RPMs and check them on your SuSE 9.0? You may also wait for a couple of days and download newer 5.0.17.

I had, finally, found where to get RedHat 9.0 from, and I suppose to try it in the virtual machine.
[16 Dec 2005 11:15] Nizamettin OZPOLAT
I have installed mysql 5.0.16 server and client and the problem solved. I don't know wether you have done anything for this problem but now there is no problem. Thank you for your interest.
[17 Dec 2005 11:44] Valeriy Kravchuk
The problem is not repeatable with 5.0.16. So, I believe, it is solved, either by some fix to other bug report, or by relink and repackaging.