Details
-
Type:
Bug
-
Status: Stalled
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 10.0.13
-
Fix Version/s: 10.0
-
Component/s: Data Definition - Procedure
-
Labels:
-
Sprint:10.0.21
Description
Crash with the following stack trace happened at a customer:
> mysqld.exe!Field_string::type() Line 2239 + 0x15 bytes C++ mysqld.exe!memcpy_field_possible(Field * to, Field * from) Line 840 + 0x10 bytes C++ mysqld.exe!field_conv(Field * to, Field * from) Line 865 + 0x5 bytes C++ mysqld.exe!save_field_in_field(Field * from, bool * null_value, Field * to, bool no_conversions) Line 5978 C++ mysqld.exe!sp_eval_expr(THD * thd, Field * result_field, Item * * expr_item_ptr) Line 434 C++ mysqld.exe!sp_rcontext::set_variable(THD * thd, Field * field, Item * * value) Line 377 + 0xe bytes C++ mysqld.exe!sp_cursor::Select_fetch_into_spvars::send_data(List<Item> & items) Line 553 + 0x25 bytes C++ mysqld.exe!Materialized_cursor::fetch(unsigned long num_rows) Line 339 + 0x10 bytes C++ mysqld.exe!sp_cursor::fetch(THD * thd, List<sp_variable> * vars) Line 510 C++ mysqld.exe!sp_instr_cfetch::execute(THD * thd, unsigned int * nextp) Line 3864 + 0xe bytes C++ mysqld.exe!sp_head::execute(THD * thd, bool merge_da_on_success) Line 1366 + 0x11 bytes C++ mysqld.exe!sp_head::execute_procedure(THD * thd, List<Item> * args) Line 2152 + 0xe bytes C++ mysqld.exe!mysql_execute_command(THD * thd) Line 4688 + 0x13 bytes C++ mysqld.exe!mysql_parse(THD * thd, char * rawbuf, unsigned int length, Parser_state * parser_state) Line 6416 C++ mysqld.exe!dispatch_command(enum_server_command command, THD * thd, char * packet, unsigned int packet_length) Line 1310 C++ mysqld.exe!do_command(THD * thd) Line 1011 C++ mysqld.exe!threadpool_process_request(THD * thd) Line 233 + 0x8 bytes C++ mysqld.exe!io_completion_callback(_TP_CALLBACK_INSTANCE * instance, void * context, void * overlapped, unsigned long io_result, unsigned __int64 nbytes, _TP_IO * io) Line 568 + 0x17 bytes C++ kernel32.dll!BasepTpIoCallback() + 0x52 bytes ntdll.dll!TppIopExecuteCallback() + 0x1ba bytes ntdll.dll!TppWorkerThread() + 0x33f bytes kernel32.dll!BaseThreadInitThunk() + 0xd bytes ntdll.dll!RtlUserThreadStart() + 0x21 bytes
We were unable to get a small repeatable testcase, but under customer' load the crash is reproducible.
Gliffy Diagrams
Attachments
Issue Links
- relates to
-
MDEV-7040 Crash in field_conv, memcpy_field_possible, part#2
-
- Open
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Some details from my attempt to investigate
So, in memcpy_field_possible() we crash at this line:
const enum_field_types to_type= from->type();
Let's assume for the sake of investigation that from=NULL (or an invalid pointer)
the caller function is:
int field_conv(Field *to,Field *from)
keep the assumption, from=NULL. The caller is:
static int save_field_in_field(Field *from, bool *null_value,
Field *to, bool no_conversions)
which has:
res= field_conv(to, from);
however, above that, the function has:
if (from->is_null())
{
...
if we had from==NULL here, we would have crashed earlier.