Bug #30329 main.information_schema_chmod test
Submitted: 9 Aug 2007 10:25 Modified: 19 Nov 2007 4:48
Reporter: Jonathan Perkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S2 (Serious)
Version:5.2.5-alpha OS:Any
Assigned to: Alexey Botchkov CPU Architecture:Any
Tags: Contribution

[9 Aug 2007 10:25] Jonathan Perkin
Description:
The main.information_schema_chmod test attempts to change the permissions on the mysqltest directory, but the command to restore sane permissions fails.  This causes failure for every single subsequent test which is unable to use the test directory.

main.information_schema_chmod  [ fail ]

ERROR: mysqltest returned unexpected code 139, it has probably crashed

Stopping All Servers
Restoring snapshot of databases
Can't chdir to .../mysql-test/var/master-data/mysqltest (Permission denied) at ./mysql-test-run.pl line 3615

d---------  2 mysqldev users 4096 2007-08-02 04:11 mysqltest

How to repeat:
Run the test suite (mysql-test-run.pl)

Suggested fix:
===== information_schema_chmod.test 1.3 vs edited =====
--- 1.3/mysql-test/t/information_schema_chmod.test      2007-08-09 12:23:58 +02:00
+++ edited/information_schema_chmod.test        2007-08-09 12:23:49 +02:00
@@ -19,5 +19,5 @@ create database mysqltest;
 create table mysqltest.t1(a int);
 chmod 0000 $MYSQLTEST_VARDIR/master-data/mysqltest;
 select table_schema from information_schema.tables where table_schema='mysqltest';
-exec chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest;
+chmod 0777 $MYSQLTEST_VARDIR/master-data/mysqltest;
 drop database mysqltest;
[9 Aug 2007 11:13] Sveta Smirnova
Thank you for the report.

I can not repeat described behaviour as regular user I guild sources as. Please indicate accurate version of OS where bug is repeatable and provide ouptut of `ls -la /PATH/TO/SOURCES/mysql-test`
[9 Aug 2007 11:13] Sveta Smirnova
s/guild/build/ in previous comment
[9 Aug 2007 14:58] Jonathan Perkin
Sorry, looks like this one is a red herring, the real problem is mysqltest_embedded segfaults on Linux 64bit and PPC machines, which is what causes this test to fail mid way through and break the permissions.

I'm currently trying to get more information from a debug build to track down the bug.
[9 Aug 2007 16:01] Jonathan Perkin
Running the following within gdb:

  $ MTR_BUILD_THREAD=auto /usr/bin/perl ./mysql-test-run.pl --comment=embedded --force --timer --embedded-server --skip-rpl --skip-ndbcluster

warning: linux_test_for_tracefork: unexpected result from waitpid (21882, status 0x117f)
[Thread debugging using libthread_db enabled]
[New Thread 182903849120 (LWP 21881)]
[New Thread 1084230000 (LWP 21884)]
mysql_embedded: Table 'general_log' is marked as crashed and should be repaired
[Thread 1084230000 (zombie) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182903849120 (LWP 21881)]
emb_read_query_result (mysql=0xe53520) at lib_sql.cc:238
238       thd->first_data= res->embedded_info->next;
Current language:  auto; currently c++
(gdb) bt
#0  emb_read_query_result (mysql=0xe53520) at lib_sql.cc:238
#1  0x000000000058eb8a in mysql_read_query_result (mysql=0xe53520)
    at libmysql.c:5209
#2  0x0000000000550fd2 in run_query_normal (cn=0xe53520, command=0xef2480,
    flags=3, query=0xed5080 "show databases", query_len=14, ds=0xe81120,
    ds_warnings=0x7fbfff93e0) at mysqltest.c:5275
#3  0x0000000000551e60 in run_query (cn=0xe53520, command=0xef2480, flags=3)
    at mysqltest.c:5937
#4  0x0000000000552c66 in main (argc=1, argv=0x1) at mysqltest.c:6450
[6 Sep 2007 9:25] Sveta Smirnova
Thank you for the feedback.

Verified as described on regular Linux.

To repeat `./mysql-test-run.pl --embedded-server information_schema_chmod` is enough
[22 Oct 2007 8:07] 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/36007

ChangeSet@1.2616, 2007-10-22 12:01:39+05:00, holyfoot@mysql.com +1 -0
  bug #30329 main.information_schema_chmod test.
  
  the check_grant call was #ifdef-ed inproperly in check_table_access()
  what cause wrong return and crash of the embedded server.
[23 Oct 2007 9:46] Sergei Glukhov
ok to push
[16 Nov 2007 9:36] Bugs System
Pushed into 6.0.4-alpha
[19 Nov 2007 4:48] Paul DuBois
Noted in 6.0.4 changelog.

A table-access check was performed improperly by libmysqld, causing a crash.
[30 Dec 2009 4:46] Michael Pelletier
Has this been resolved? I am having the same issues on a debian 5.0 64 bit machine.

main.information_schema_chmod            [ fail ]
        Test ended at 2009-12-29 23:21:14

CURRENT_TEST: main.information_schema_chmod
--- /usr/local/Source/MySQL/mysql-5.1.41/mysql-test/r/information_schema_chmod.result	2009-11-04 22:01:14.000000000 +0300
+++ /usr/local/Source/MySQL/mysql-5.1.41/mysql-test/r/information_schema_chmod.reject	2009-12-30 07:21:14.000000000 +0300
@@ -2,4 +2,5 @@
 create table mysqltest.t1(a int);
 select table_schema from information_schema.tables where table_schema='mysqltest';
 table_schema
+mysqltest
 drop database mysqltest;

mysqltest: Result length mismatch

 - saving '/usr/local/Source/MySQL/mysql-5.1.41/mysql-test/var/log/main.information_schema_chmod/' to '/usr/local/Source/MySQL/mysql-5.1.41/mysql-test/var/log/main.information_schema_chmod/'

Only  587  of 920 completed.
mysql-test-run: *** ERROR: Not all tests completed
make: *** [test-ns] Error 1
[26 Feb 2010 18:25] gav white
I'm also having same issue on OS X (10.6.2) machine.