Bug #48866 mysql.test fails under Fedora 12
Submitted: 18 Nov 2009 15:20 Modified: 12 Mar 2010 16:48
Reporter: Georgi Kodinov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0, 5.1 OS:Linux (Fedora 12 x86_64)
Assigned to: Georgi Kodinov CPU Architecture:Any
Triage: Triaged: D4 (Minor)

[18 Nov 2009 15:20] Georgi Kodinov
Description:
mysql.test fails when run on Fedora 12 x86_64 in the following way : 
TEST                           RESULT         TIME (ms)
-------------------------------------------------------

mysql                          [ fail ]

--- /home/kgeorge/mysql/work/test-5.0-bugteam/mysql-test/r/mysql.result 2009-11-18 16:58:07.000000000 +0300
+++ /home/kgeorge/mysql/work/test-5.0-bugteam/mysql-test/r/mysql.reject 2009-11-18 18:17:49.000000000 +0300
@@ -165,7 +165,7 @@
 ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
 ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
 The commands reported in the bug report
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
+ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyrilhas' (errno)
 Too long dbname
 ERROR 1049 (42000) at line 1: Unknown database 'test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
 Too long hostname

mysqltest: Result content mismatch

How to repeat:
Compile a fresh 5.0 or 5.1 tree using BUILD/compile-pentium-debug-max on Fedora 12 and run the test. See Bug #48864 on how to get past the compilation problem.

Suggested fix:
fix the test so it doesn't depend on how the OS returns the server name.
[19 Nov 2009 19:26] Sveta Smirnova
Thank you for the feedback.

I can not repeat this too. How do you compile MySQL server?
[20 Nov 2009 13:50] Oliver Heil
Hello,

I also get the failure with Fedora 12 and mysql-5.0.87:

[root@dbm02 mysql-test]# uname -a
Linux dbm02 2.6.31.5-127.fc12.x86_64 #1 SMP Sat Nov 7 21:11:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

configuring with:

[root@dbm02 mysql-test]# ./configure --prefix=/usr/local/mysql-5.0.87-gcc2 --without-debug --enable-thread-safe-client --enable-local-infile --enable-assembler --disable-shared --with-mysqld-ldflags=-static --with-client-ldflags=-static

[root@dbm02 mysql-test]# ./mtr
Logging: ./mtr
MySQL Version 5.0.87
Skipping ndbcluster, mysqld not compiled with ndbcluster
Skipping SSL, mysqld not compiled with SSL
Using MTR_BUILD_THREAD      = 0
Using MASTER_MYPORT         = 9306
Using MASTER_MYPORT1        = 9307
Using SLAVE_MYPORT          = 9308
Using SLAVE_MYPORT1         = 9309
Using SLAVE_MYPORT2         = 9310
Using IM_PORT               = 9313
Using IM_MYSQLD1_PORT       = 9314
Using IM_MYSQLD2_PORT       = 9315
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
Installing Master Database
Installing Slave1 Database
mysql-test-run: WARNING: running this script as _root_ will cause some tests to be skipped
=======================================================
Starting Tests in the 'main' suite

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

...

mysql                          [ fail ]

--- /usr/local/mysql-5.0.87-gcc2/mysql-test/r/mysql.result      2009-11-20 13:18:37.699184930 +0300
+++ /usr/local/mysql-5.0.87-gcc2/mysql-test/r/mysql.reject      2009-11-20 16:35:58.885996135 +0300
@@ -165,7 +165,7 @@
 ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
 ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
 The commands reported in the bug report
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
+ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyrilhas' (errno)
 Too long dbname
 ERROR 1049 (42000) at line 1: Unknown database 'test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
 Too long hostname

mysqltest: Result content mismatch
[20 Nov 2009 14:20] Georgi Kodinov
What locale are you using ? I'm using the following : 
LANG=bg_BG.UTF-8
My versioning is as follows : 
gcc (GCC) 4.4.2 20091027 (Red Hat 4.4.2-7)
GNU C Library stable release version 2.11, by Roland McGrath et al.
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.2 20091027 (Red Hat 4.4.2-7).
Compiled on a Linux >>2.6.18-164.2.1.el5<< system on 2009-11-05.
Available extensions:
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
        RT using linux kernel aio

I also have selinux disabled.
[20 Nov 2009 15:22] Oliver Heil
Hello, here are the infos, selinux is disabled too:

[root@dbm02 mysql-test]# getenforce
Permissive

[root@dbm02 mysql-test]# cat /etc/sysconfig/i18n
LANG="de_DE"
SYSFONT="latarcyrheb-sun16"

[root@dbm02 mysql-test]# gcc --version
gcc (GCC) 4.4.2 20091027 (Red Hat 4.4.2-7)
Copyright (C) 2009 Free Software Foundation, Inc.
Dies ist freie Software; die Kopierbedingungen stehen in den Quellen. Es
gibt KEINE Garantie; auch nicht für MARKTGÄNGIGKEIT oder FÜR SPEZIELLE ZWECKE.
[21 Nov 2009 5:18] Miguel Solorzano
Now I was able to repeat on INTEL machine running FC 12 64-bit:

Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
Installing Master Database
=======================================================
Starting Tests in the 'main' suite

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

mysql                          [ fail ]

--- /home/miguel/bzr/5.0-build/mysql-test/r/mysql.result        2009-11-21 07:42:06.827761472 +0300
+++ /home/miguel/bzr/5.0-build/mysql-test/r/mysql.reject        2009-11-21 08:14:26.790027726 +0300
@@ -165,7 +165,7 @@
 ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
 ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
 The commands reported in the bug report
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
+ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyrilhas' (errno)
 Too long dbname
 ERROR 1049 (42000) at line 1: Unknown database 'test_really_long_dbnamexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
 Too long hostname

mysqltest: Result content mismatch

Aborting: mysql failed in default mode.
To continue, re-run with '--force'.
Stopping All Servers
skipped 9 bytes from file: socket (3)
[miguel@quetzal2 mysql-test]$

I failed to repeat before because  FC 12 64-bit is running on AMD machine neither the compile nor the test issues happen on AMD machine.
[8 Dec 2009 16:23] Omer Barnir
triage: setting to SR51MRU - I3 as affects development environments and slows down testing
[9 Dec 2009 11:02] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/93296

2861 Georgi Kodinov	2009-12-09
      Bug #48866: mysql.test fails under Fedora 12
      
      strmov() is not guaranteed to work correctly on overlapping
      source and destination buffers. On some OSes it may work,
      but Fedora 12 has a stpcpy() that's not working correctly 
      on overlapping buffers.
      Fixed to use the overlap-safe memmove() instead.
[16 Dec 2009 17:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/94537

2861 Georgi Kodinov	2009-12-16
      Bug #48866: mysql.test fails under Fedora 12
      
      strmov() is not guaranteed to work correctly on overlapping
      source and destination buffers. On some OSes it may work,
      but Fedora 12 has a stpcpy() that's not working correctly 
      on overlapping buffers.
      Fixed to use the overlap-safe version of strmov instead.
      Re-vitalized the overlap-safe version of strmov.
[21 Dec 2009 15:40] Tor Didriksen
Also fails in 6.0-codebase-bugfixing
[24 Dec 2009 8:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/95654

2831 Georgi Kodinov	2009-12-16
      Bug #48866: mysql.test fails under Fedora 12
      
      strmov() is not guaranteed to work correctly on overlapping
      source and destination buffers. On some OSes it may work,
      but Fedora 12 has a stpcpy() that's not working correctly 
      on overlapping buffers.
      Fixed to use the overlap-safe version of strmov instead.
      Re-vitalized the overlap-safe version of strmov.
[1 Jan 2010 15:47] TDavid Hudson
FYI, after applying the first two patches, I run into a further problem in main.mysql (on OpenSuSE 11.1: Linux linux-oz0y 2.6.27.39-0.2-default #1 SMP 2009-11-23 12:57:38 +0100 x86_64 x86_64 x86_64 GNU/Linux).  Comcast's DNS nameserver is resolving invalid_hostname and, apparently, any bogus hostname, to actual IP address 63.123.155.104 (in a range of Verizon/MCI addresses), resulting in this discrepancy:

@@ -162,8 +162,8 @@
 ERROR 1049 (42000) at line 1: Unknown database 'invalid'
 Test connect with dbname + hostname
 Test connect with dbname + _invalid_ hostname
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
+ERROR 2003 (HY000) at line 1: Can't connect to MySQL server on 'invalid_hostname' (errno)
+ERROR 2003 (HY000) at line 1: Can't connect to MySQL server on 'invalid_hostname' (errno)
 The commands reported in the bug report
 ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'cyril has found a bug :)XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (errno)
 Too long dbname
@@ -198,7 +198,7 @@
 1
 COUNT (*)
 1
-ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
+ERROR 2003 (HY000) at line 1: Can't connect to MySQL server on 'invalid_hostname' (errno)
 End of 5.0 tests
 WARNING: --server-arg option not supported in this configuration.
 Warning (Code 1286): Unknown table engine 'nonexistent'

This faulty lookup does not happen on a different, non-Linux system or when using its nameserver from my own system.  It does happen, resolving to yet another IP address, when I use yet another nameserver by specifying its domain.  My attempts so far to report the problem to Comcast have been unsuccessful.

All of "make test" passes when I temporarily change my system to use a better nameserver.

I wonder if bug #48866 would have happened in the first place without a similar nameserver problem.  It wasn't present a month or so ago using a build from the same source, on essentially the same system.
[4 Jan 2010 14:52] Georgi Kodinov
The invalid_hostname is a separate well known problem (because of the DNS server's setup). Please report this in a new bug.
[14 Jan 2010 8:27] Bugs System
Pushed into 5.0.90 (revid:joro@sun.com-20100114082402-05fod2h6z9x9wok8) (version source revid:joro@sun.com-20091216173119-9sglew79undcst7n) (merge vers: 5.0.89) (pib:16)
[15 Jan 2010 9:02] Bugs System
Pushed into 5.1.43 (revid:joro@sun.com-20100115085139-qkh0i0fpohd9u9p5) (version source revid:joro@sun.com-20091224090004-zhoioiemb6879uuk) (merge vers: 5.1.42) (pib:16)
[16 Jan 2010 2:40] Paul Dubois
Noted in 5.0.90, 5.1.43 changelogs.

On Fedora 12, strmov() did not guarantee correct operation for
overlapping source and destination buffer. Calls were fixed to use an
overlap-safe version instead. 

Setting report to NDI pending push to 5.5.x+.
[5 Feb 2010 11:50] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100204063540-9czpdmpixi3iw2yb) (version source revid:alik@sun.com-20100119163614-172adculixyu26j5) (pib:16)
[5 Feb 2010 11:56] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100205113942-oqovjy0eoqbarn7i) (version source revid:alik@sun.com-20100204064210-ljwanqvrjs83s1gq) (merge vers: 6.0.14-alpha) (pib:16)
[5 Feb 2010 12:02] Bugs System
Pushed into 5.5.2-m2 (revid:alik@sun.com-20100203172258-1n5dsotny40yufxw) (version source revid:alexey.kopytov@sun.com-20091225105650-qletdbs0wz9sx5nc) (merge vers: 5.5.1-m2) (pib:16)
[5 Feb 2010 17:04] Paul Dubois
Noted in 5.5.2, 6.0.14 changelogs.

Setting report to Need Merge pending push to Celosia.
[12 Mar 2010 14:15] Bugs System
Pushed into 5.1.44-ndb-7.0.14 (revid:jonas@mysql.com-20100312135944-t0z8s1da2orvl66x) (version source revid:jonas@mysql.com-20100312115609-woou0te4a6s4ae9y) (merge vers: 5.1.44-ndb-7.0.14) (pib:16)
[12 Mar 2010 14:31] Bugs System
Pushed into 5.1.44-ndb-6.2.19 (revid:jonas@mysql.com-20100312134846-tuqhd9w3tv4xgl3d) (version source revid:jonas@mysql.com-20100312060623-mx6407w2vx76h3by) (merge vers: 5.1.44-ndb-6.2.19) (pib:16)
[12 Mar 2010 14:47] Bugs System
Pushed into 5.1.44-ndb-6.3.33 (revid:jonas@mysql.com-20100312135724-xcw8vw2lu3mijrhn) (version source revid:jonas@mysql.com-20100312103652-snkltsd197l7q2yg) (merge vers: 5.1.44-ndb-6.3.33) (pib:16)
[12 Mar 2010 16:48] Paul Dubois
Fixed in earlier 5.1.x, 5.5.x.