Bug #47521 crash and memory corruption with events
Submitted: 22 Sep 2009 14:55 Modified: 11 Feb 2011 7:08
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S1 (Critical)
Version:5.1.38 OS:Windows (xp64)
Assigned to: CPU Architecture:Any
Tags: crash, valgrind

[22 Sep 2009 14:55] Shane Bester
Description:
during some tests with events and stored routines i saw evidence of memory corruption, and later a crash:

mysqld.exe!my_utf8_uni()[ctype-utf8.c:1954]
mysqld.exe!my_well_formed_len_mb()[ctype-mb.c:297]
mysqld.exe!well_formed_copy_nchars()[sql_string.cc:1000]
mysqld.exe!Field_blob::store()[field.cc:7722]
mysqld.exe!fill_schema_processlist()[sql_show.cc:1893]
mysqld.exe!get_schema_tables_result()[sql_show.cc:6026]
mysqld.exe!JOIN::exec()[sql_select.cc:1730]
mysqld.exe!mysql_select()[sql_select.cc:2400]
mysqld.exe!handle_select()[sql_select.cc:268]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:5012]
mysqld.exe!mysql_execute_command()[sql_parse.cc:2206]
mysqld.exe!sp_instr_stmt::exec_core()[sp_head.cc:2906]
mysqld.exe!sp_lex_keeper::reset_lex_and_exec_core()[sp_head.cc:2734]
mysqld.exe!sp_instr_stmt::execute()[sp_head.cc:2850]
mysqld.exe!sp_head::execute()[sp_head.cc:1254]
mysqld.exe!sp_head::execute_procedure()[sp_head.cc:1982]
mysqld.exe!Event_job_data::execute()[event_data_objects.cc:1462]
mysqld.exe!Event_worker_thread::run()[event_scheduler.cc:309]
mysqld.exe!event_worker_thread()[event_scheduler.cc:266]
mysqld.exe!pthread_start()[my_winthread.c:85]
mysqld.exe!_callthreadstart()[thread.c:295]
mysqld.exe!_threadstart()[thread.c:275]
kernel32.dll!BaseThreadStart()

query in the event was: select id from information_schema.processlist order by rand() limit 1 into @a

debug binary had messages like this (indicating memory overrun):
[Warning] Event Scheduler: [root@127.0.0.1][test.myevent6] Incorrect string value: '\xEE\xFE\xEE\xFE\xEE\xFE...' for column 'INFO' at row 0
[Warning] Event Scheduler: [root@127.0.0.1][test.myevent6] Incorrect string value: '\xA5\xA5\xA5\xA5\xA5\xA5...' for column 'INFO' at row 0

How to repeat:
not sure yet.