Bug #34761 Mysql-test-run.pl script hangs on Windows
Submitted: 22 Feb 2008 15:23 Modified: 26 Mar 2008 19:47
Reporter: Chuck Bell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.1, 6.0 OS:Any
Assigned to: Magnus BlÄudd CPU Architecture:Any

[22 Feb 2008 15:23] Chuck Bell
Description:
The mysql-test-run.pl script hangs when run on Windows. The script produces this output before hanging:

$ ./mysql-test-run.pl
Logging: ./mysql-test-run.pl
080221 13:46:27 [Warning] Can't create test file \tmp\NuvmIyxvt9\mysql_cab_desk.
lower-test
080221 13:46:27 [Warning] Can't create test file \tmp\NuvmIyxvt9\mysql_cab_desk.
lower-test
d:\source\c++\mysql-6.0_WL_4209\sql\debug\mysqld.exe: Can't change dir to '\tmp\ NuvmIyxvt9\' (Errcode: 2) MySQL Version 6.0.5 Using dynamic switching of binlog format Skipping ndbcluster, mysqld not compiled with ndbcluster Setting mysqld to support SSL connections Binaries are debug compiled
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

In pushbuild, the test failures look like this:

 n_mix: FAILED (1202 sec)  
 ps_row: FAILED (1202 sec)  

A debugging session revealed the script gets hung in this loop (line #415-ish).

      while (!$found and !($ccc eq "/") and !($ccc eq ""))
      {
	my $ddd= basename($ccc);
	foreach my $extra_suite (@extra_suites)
	{
	  if ($extra_suite->[0] eq "$ddd")
	  {
	    $opt_suites= "$extra_suite->[1],$opt_suites";
	    $found= 1;
	  }
	}
	$ccc= dirname($ccc);
      }
    }

I edited the script for debugging:

	my $ddd= basename($ccc);
+      print "$found $ccc $ddd\n";
+      if ($ccc eq ".")
+      {
+        $found= 1;
+      }

...and got this output:

0 d:/source/c++/mysql-6.0_WL_4209 mysql-6.0_WL_4209 0 d:/source/c++ c++ 
0 d:/source source 
0 d: d:
0 . .

(note: If I didn't stop the loop it would print '0 . .' forever)

How to repeat:
clone and build mysql-6.0-backup (or mysql-6.0 or mysql-5.1)
./mysql-test-run.pl
observe the hang...

Suggested fix:
Add an additional clause for the while loop to check for '.':

-      while (!$found and !($ccc eq "/") and !($ccc eq ""))
+      while (!$found and !($ccc eq "/") and !($ccc eq "") and !($ccc eq "."))
[22 Feb 2008 16:35] Chuck Bell
Here is the diff for the code patch against mysql-5.1-new-rpl.

===== mysql-test-run.pl 1.349 vs edited =====
--- 1.349/mysql-test/mysql-test-run.pl  2008-02-13 14:51:55 -05:00
+++ edited/mysql-test-run.pl    2008-02-22 11:24:58 -05:00
@@ -418,7 +418,7 @@
       $opt_suites= $opt_suites_default;
       my $ccc= dirname($glob_mysql_test_dir);
       my $found= 0;
-      while (!$found and !($ccc eq "/") and !($ccc eq ""))
+      while (!$found and !($ccc eq "/") and !($ccc eq "") and !($ccc eq "."))
       {
        my $ddd= basename($ccc);
        foreach my $extra_suite (@extra_suites)
[22 Feb 2008 16:40] 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/42851

ChangeSet@1.2531, 2008-02-22 17:40:14+01:00, msvensson@pilot.mysql.com +1 -0
  Bug#34761 Mysql-test-run.pl script hangs on Windows
[25 Mar 2008 15:25] 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/44407

ChangeSet@1.2545, 2008-03-25 16:27:23+01:00, msvensson@pilot.mysql.com +1 -0
  Bug#34761 Mysql-test-run.pl script hangs on Windows
[25 Mar 2008 15:27] 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/44409

ChangeSet@1.2585, 2008-03-25 16:29:32+01:00, msvensson@pilot.mysql.com +1 -0
  Bug#34761 Mysql-test-run.pl script hangs on Windows
[26 Mar 2008 19:00] Bugs System
Pushed into 6.0.5-alpha
[26 Mar 2008 19:47] Paul DuBois
Test suite change. No changelog entry needed.
[31 Mar 2008 7:56] Bugs System
Pushed into 5.1.24-rc
[30 Jan 2009 13:30] Bugs System
Pushed into 6.0.10-alpha (revid:luis.soares@sun.com-20090129165607-wiskabxm948yx463) (version source revid:luis.soares@sun.com-20090129163120-e2ntks4wgpqde6zt) (merge vers: 6.0.10-alpha) (pib:6)
[30 Jan 2009 15:10] Bugs System
Pushed into 5.1.32 (revid:luis.soares@sun.com-20090129165946-d6jnnfqfokuzr09y) (version source revid:sp1r-msvensson@pilot.mysql.com-20080325174049-18586) (merge vers: 5.1.24-rc) (pib:6)
[17 Feb 2009 14:59] Bugs System
Pushed into 5.1.32-ndb-6.3.23 (revid:tomas.ulin@sun.com-20090217131017-6u8qz1edkjfiobef) (version source revid:tomas.ulin@sun.com-20090203133556-9rclp06ol19bmzs4) (merge vers: 5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 2009 16:46] Bugs System
Pushed into 5.1.32-ndb-6.4.3 (revid:tomas.ulin@sun.com-20090217134419-5ha6xg4dpedrbmau) (version source revid:tomas.ulin@sun.com-20090203133556-9rclp06ol19bmzs4) (merge vers: 5.1.32-ndb-6.3.22) (pib:6)
[17 Feb 2009 18:22] Bugs System
Pushed into 5.1.32-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090217134216-5699eq74ws4oxa0j) (version source revid:tomas.ulin@sun.com-20090201210519-vehobc4sy3g9s38e) (merge vers: 5.1.32-ndb-6.2.17) (pib:6)