[MDEV-4520] Assertion `0' fails in Query_cache::end_of_result on concurrent drop event and event execution Created: 2013-05-14  Updated: 2013-05-31  Resolved: 2013-05-31

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.2, 5.5.31
Fix Version/s: 10.0.3, 5.5.32

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates

 Description   

Version: '5.5.31-MariaDB-valgrind-max-debug-log'  socket: '/data/repo/bzr/5.5/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
130514  3:43:29 [Note] Event Scheduler: scheduler thread started with id 8
mysqld: /home/elenst/bzr/5.5/sql/sql_cache.cc:1211: void Query_cache::end_of_result(THD*): Assertion `0' failed.
130514  3:43:29 [ERROR] mysqld got signal 6 ;

#7  0x00007f1574b1d192 in __GI___assert_fail (assertion=0xd615d2 "0", file=0xd61058 "/home/elenst/bzr/5.5/sql/sql_cache.cc", line=1211, function=0xd63b40 "void Query_cache::end_of_result(THD*)") at assert.c:103
#8  0x00000000005c7837 in Query_cache::end_of_result (this=0x14fd520, thd=0x7f1540001cc0) at /home/elenst/bzr/5.5/sql/sql_cache.cc:1211
#9  0x000000000090e66b in sp_instr_stmt::execute (this=0x7f1544002c98, thd=0x7f1540001cc0, nextp=0x7f1565ef34f8) at /home/elenst/bzr/5.5/sql/sp_head.cc:3134
#10 0x000000000090a22a in sp_head::execute (this=0x7f15440033b8, thd=0x7f1540001cc0, merge_da_on_success=true) at /home/elenst/bzr/5.5/sql/sp_head.cc:1428
#11 0x000000000090c0b8 in sp_head::execute_procedure (this=0x7f15440033b8, thd=0x7f1540001cc0, args=0x7f1565ef38a0) at /home/elenst/bzr/5.5/sql/sp_head.cc:2185
#12 0x00000000006fad17 in Event_job_data::execute (this=0x7f1565ef3d10, thd=0x7f1540001cc0, drop=false) at /home/elenst/bzr/5.5/sql/event_data_objects.cc:1433
#13 0x000000000094ec25 in Event_worker_thread::run (this=0x7f1565ef3e4f, thd=0x7f1540001cc0, event=0x7f1540001bf0) at /home/elenst/bzr/5.5/sql/event_scheduler.cc:317
#14 0x000000000094ea9d in event_worker_thread (arg=0x7f1540001bf0) at /home/elenst/bzr/5.5/sql/event_scheduler.cc:274
#15 0x0000000000977c3e in pfs_spawn_thread (arg=0x7f154000b190) at /home/elenst/bzr/5.5/storage/perfschema/pfs.cc:1015
#16 0x00007f15758ede9a in start_thread (arg=0x7f1565ef4700) at pthread_create.c:308
#17 0x00007f1574be1cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f51240031d8): select * from t28953
Connection ID (thread ID): 10
Status: NOT_KILLED

It's a race condition repeatable with some probability by running test rpl.rpl_events with query cache enabled:

perl ./mtr rpl.rpl_events --mysqld=--query-cache-size=1048576 --mysqld=--binlog-format=row --repeat=20

On my machine 3..5 attempts is usually enough to hit the failure.

bzr version-info

revision-id: sergii@pisem.net-20130513141139-vl0ehunm2bwgx1s9
revno: 3764
branch-nick: 5.5

1202:    if (header->result() == 0)
1203:    {
1204:      DBUG_PRINT("error", ("End of data with no result blocks; "
1205:                           "Query '%s' removed from cache.", header->query()));
1206:      /*
1207:        Extra safety: empty result should not happen in the normal call
1208:        to this function. In the release version that query should be ignored
1209:        and removed from QC.
1210:      */
1211:      DBUG_ASSERT(0);
1212:      free_query(query_block);
1213:      unlock();
1214:      DBUG_VOID_RETURN;
1215:    }



 Comments   
Comment by Oleksandr Byelkin [ 2013-05-22 ]

Problem was in absence net.vio so QC can't intercept data.

fix committed for review.

Comment by Oleksandr Byelkin [ 2013-05-23 ]

second version committed for review

Comment by Oleksandr Byelkin [ 2013-05-28 ]

Pushed to 5.5

Comment by Oleksandr Byelkin [ 2013-05-30 ]

Fix for embedded pushed to 5.5

Generated at Thu Feb 08 06:57:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.