Assertion `0' failed in net_end_statement(THD*) on concurrent SELECT FROM I_S.INNODB_SYS_INDEXES and ALTER TABLE

Bug #933959 reported by Elena Stepanova
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Medium
Sergei Golubchik
Percona Server moved to https://jira.percona.com/projects/PS
Incomplete
Medium
Unassigned
5.1
Won't Fix
Medium
Unassigned
5.5
Incomplete
Medium
Unassigned

Bug Description

Version: '5.3.4-MariaDB-rc-debug-log'
mysqld: protocol.cc:509: void net_end_statement(THD*): Assertion `0' failed.

#8 0xb741d014 in __assert_fail () from /lib/libc.so.6
#9 0x082c4fad in net_end_statement (thd=0x9eebc88) at protocol.cc:509
#10 0x082e2484 in dispatch_command (command=COM_QUERY, thd=0x9eebc88,
    packet=0x9eede31 "SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES", packet_length=51)
    at sql_parse.cc:1620
#11 0x082e08df in do_command (thd=0x9eebc88) at sql_parse.cc:923
#12 0x082dd865 in handle_one_connection (arg=0x9eebc88) at sql_connect.cc:1193
#13 0xb76abb25 in start_thread () from /lib/libpthread.so.0

Query (0x9f2e398): SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES
Connection ID (thread ID): 4
Status: NOT_KILLED

bzr version-info
revision-id: <email address hidden>
date: 2012-02-16 20:15:57 +0400
build-date: 2012-02-17 07:40:46 +0400
revno: 3424

Also reproducible on MariaDB 5.1 and 5.2.
Could not reproduce on 5.5, but the test is not deterministic., so there is no guarantee. It is, however, noticeable, that the flow works much slower on 5.5

# MTR test case (please note that the number of attempts is set in the $run variable):

--source include/have_innodb.inc

CREATE TABLE t1 (
  a DATE,
  b TIME,
  c VARCHAR(1),
  d INT
) ENGINE=InnoDB;
--connect (con1,127.0.0.1,root,,test)
--connect (con2,127.0.0.1,root,,test)
let $run=1000;
--disable_query_log
--disable_result_log
while ($run)
{
  --echo # $run attempts left
  --connection con1
  --send
    ALTER TABLE t1 ADD KEY(d);
  --connection con2
  SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES;
  --connection con1
  --reap
  ALTER TABLE t1 DROP KEY d;
  --dec $run
}

# End of test case

Related branches

Revision history for this message
Sergei Golubchik (sergii) wrote :

it's xtradb bug. eventually in the test case it tries to put some garbage into a row of the I_S.INNODB_SYS_INDEXES table, that fails, and the error is propagated all the way up. The assertion in the server fires because the error is not sent to the user. I'll fix that - the server will send a generic error if an I_S plugin failed without reporting an error. But the real bug is trying to put garbage into INNODB_SYS_INDEXES. This should've not happened in the first place.

affects: maria → percona-xtradb
Changed in percona-xtradb:
assignee: Sergei (sergii) → nobody
milestone: 5.1 → none
Changed in maria:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Sergei (sergii)
milestone: none → 5.2
milestone: 5.2 → 5.1
status: In Progress → Fix Committed
Elena Stepanova (elenst)
tags: added: xtradb
tags: added: assertion
affects: percona-xtradb → percona-server
Changed in maria:
status: Fix Committed → Fix Released
Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :
Download full text (20.9 KiB)

Couldn't reproduce with PS 5.5

sudo ./mysql-test-run.pl --vardir=$HOME/mysql --extern "socket=/run/mysqld/mysqld.sock" --extern user=root --extern password=test t/933959.test
defined(@array) is deprecated at lib/mtr_cases.pm line 338.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at ./mysql-test-run.pl line 519.
        (Maybe you should just omit the defined()?)
Logging: ./mysql-test-run.pl --vardir=/home/raghu/mysql --extern socket=/run/mysqld/mysqld.sock --extern user=root --extern password=test t/933959.test
MySQL Version 5.5.27
Checking supported features...
 - skipping ndbcluster
 - skipping SSL, mysqld not compiled with SSL
Collecting tests...
vardir: /home/raghu/mysql
Using server port 40822

==============================================================================

TEST RESULT TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
worker[1] mysql-test-run: WARNING: running this script as _root_ will cause some tests to be skipped
CREATE TABLE t1 (
a DATE,
b TIME,
c VARCHAR(1),
d INT
) ENGINE=InnoDB;
# 1000 attempts left
# 999 attempts left
# 998 attempts left
# 997 attempts left
# 996 attempts left
# 995 attempts left
# 994 attempts left
# 993 attempts left
# 992 attempts left
# 991 attempts left
# 990 attempts left
# 989 attempts left
# 988 attempts left
# 987 attempts left
# 986 attempts left
# 985 attempts left
# 984 attempts left
# 983 attempts left
# 982 attempts left
# 981 attempts left
# 980 attempts left
# 979 attempts left
# 978 attempts left
# 977 attempts left
# 976 attempts left
# 975 attempts left
# 974 attempts left
# 973 attempts left
# 972 attempts left
# 971 attempts left
# 970 attempts left
# 969 attempts left
# 968 attempts left
# 967 attempts left
# 966 attempts left
# 965 attempts left
# 964 attempts left
# 963 attempts left
# 962 attempts left
# 961 attempts left
# 960 attempts left
# 959 attempts left
# 958 attempts left
# 957 attempts left
# 956 attempts left
# 955 attempts left
# 954 attempts left
# 953 attempts left
# 952 attempts left
# 951 attempts left
# 950 attempts left
# 949 attempts left
# 948 attempts left
# 947 attempts left
# 946 attempts left
# 945 attempts left
# 944 attempts left
# 943 attempts left
# 942 attempts left
# 941 attempts left
# 940 attempts left
# 939 attempts left
# 938 attempts left
# 937 attempts left
# 936 attempts left
# 935 attempts left
# 934 attempts left
# 933 attempts left
# 932 attempts left
# 931 attempts left
# 930 attempts left
# 929 attempts left
# 928 attempts left
# 927 attempts left
# 926 attempts left
# 925 attempts left
# 924 attempts left
# 923 attempts left
# 922 attempts left
# 921 attempts left
# 920 attempts left
# 919 attempts left
# 918 attempts left
# 917 attempts left
# 916 attempts left
# 915 attempts left
# 914 attempts left
# 913 attempts left
# 912 attempts left
# 911 attempts left
# 910 attempts left
# 909 attempts left
# 908 attempts left
# 907 attempts left
# 906 attempts left
# 905 attempts left
# 904 attempts left
# 903 attempts left
# 902 attempts left
...

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

If, as Sergei writes, "the real bug is trying to put garbage into INNODB_SYS_INDEXES", then we cannot mark it as invalid because this testcase passes. It's not deterministic and the code might have been perturbed enough to hide it. Setting to Incomplete for now.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1239

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.