[MDEV-6799] Crash in field_conv, memcpy_field_possible Created: 2014-09-26 Updated: 2015-12-08 Resolved: 2015-12-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Procedure |
| Affects Version/s: | 10.0.13 |
| Fix Version/s: | 10.0.20 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sp | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.0.21 | ||||||||
| Description |
|
Crash with the following stack trace happened at a customer:
We were unable to get a small repeatable testcase, but under customer' load the crash is reproducible. |
| Comments |
| Comment by Sergei Petrunia [ 2014-09-26 ] | ||||||||||||||||||||||
|
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) 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, 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. | ||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2014-09-26 ] | ||||||||||||||||||||||
|
it seems, the function is called for valid Field objects: at the start of memcpy_field_possible(), there are these calls:
and we didn't crash there. real_type() have trivial {return $type; }implementations, so the fact that they succeeded only means that field object is valid. The call to from->type() crashes. I assume that orig_table has invalid value. It was probably invalid in 5.5 also. But, before the fix for | ||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2014-09-26 ] | ||||||||||||||||||||||
|
The patch is at | ||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2014-11-07 ] | ||||||||||||||||||||||
|
We've got a script that allows to repeat the problem: see CSC#8034, stress_minimal.sql. I was using 10.0.13, compiled with "cmake . ; make " and I got:
| ||||||||||||||||||||||
| Comment by Lawrin Novitsky [ 2015-07-06 ] | ||||||||||||||||||||||
|
Hi, mysqld.exe!Field_string::type() Line 2279 + 0x15 bytes C++ Might be that bug needs to be re-open | ||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-07-06 ] | ||||||||||||||||||||||
|
Reopening due to reports that the crash is still observable. | ||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-07-29 ] | ||||||||||||||||||||||
|
Lawrin Lawrin , can you post the stack trace here? I have succeded in loading the minidump into WinDbg but couldn't get any further.. The reason for asking is that I've now got a patch for | ||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-07-30 ] | ||||||||||||||||||||||
|
Ok it was a misunderstanding, the stack trace is as posted above in the comment dated 2015-07-06 17:23. This is supposed to be fixed by | ||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2015-12-08 ] | ||||||||||||||||||||||
|
Closing this as a proper fix for this problem was done as a part of |