[MDEV-19485] [FATAL] InnoDB: Data field type 0, len 32 in dfield_check_typed, ASAN global-buffer-overflow in rtree_get_geometry_mbr Created: 2019-05-15 Updated: 2019-05-16 Resolved: 2019-05-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, GIS, Storage Engine - InnoDB |
| Affects Version/s: | 10.4.0 |
| Fix Version/s: | 10.4.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Run with --repeat=N, big enough N. It usually fails for me within ~40 attempts, but it's not a guarantee.
On a non-ASAN debug build:
Reproducible on 10.4, including 10.4.4. On an ASAN build:
Couldn't reproduce on current 10.3. Didn't try 10.4.4 or older 10.3. I'm not sure whether these two failures are related. If not, please feel free to split the bug report into two. |
| Comments |
| Comment by Marko Mäkelä [ 2019-05-16 ] | ||||||||||||||||||||||||||||||||||
|
I can repeat the ASAN failure. | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-05-16 ] | ||||||||||||||||||||||||||||||||||
|
The two errors can be related. This looks like an uninitialized data field:
The data_error is a sentinel byte for debug builds that is now helping AddressSanitizer catch the error. In row_build_spatial_index_key(), we seem to have dptr = data_error coming from here:
Notably, we have dfield_is_null(dfield2) (even though SPATIAL INDEX should never be allowed on NULL columns) and are yet proceeding to the purge:
Here is a deterministic test case. It fails to repeat the problem for 10.2 for me.
In 10.3, some code was refactored into a new function row_build_spatial_index_key(). The above test will not fail for me on 10.3 either. | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-05-16 ] | ||||||||||||||||||||||||||||||||||
|
In purge, in the table row (node->row) over (g,DB_ROW_ID,DB_TRX_ID,DB_ROLL_PTR), the value of the column g is undefined (data=&data_error, len=~0U). The secondary index is empty, just like expected. The clustered index contains the following delete-marking record that is awaiting purge: The data_error must be there because the data was simply not available to row_purge_parse_undo_rec() in the undo_rec. We still need to figure out how to fix this, and why 10.2 or 10.3 did not crash or report anything. | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-05-16 ] | ||||||||||||||||||||||||||||||||||
|
Both incarnations of the problem share a common root cause. The "data field type 0" is the magic value DATA_MISSING, which 10.4 fails to check before the function call row_build_spatial_index_key() due to some code refactoring in row_build_index_entry_low() as part of |