[MDEV-11607] Server crashes in __memcpy_sse2_unaligned / String::realloc_raw / Field_blob::store_field Created: 2016-12-19  Updated: 2017-02-09  Resolved: 2017-02-09

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Virtual Columns
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Duplicate Votes: 0
Labels: 10.2-rc

Issue Links:
Duplicate
is duplicated by MDEV-11604 Assertion `!check_datetime_range(ltim... Closed
Relates
relates to MDEV-5800 indexes on virtual (not materialized)... Closed

 Description   

10.2 c35b8c46b404d035e54a23d667da5dff6502fc2e

#3  <signal handler called>
#4  __memcpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S:33
#5  0x00007fb2e2f0ea34 in String::realloc_raw (this=this@entry=0x7fb2baa19b08, alloc_length=alloc_length@entry=3472883712) at /data/src/10.2/sql/sql_string.cc:109
#6  0x00007fb2e2f0eb12 in realloc (arg_length=3472883712, this=0x7fb2baa19b08) at /data/src/10.2/sql/sql_string.h:367
#7  String::copy (this=this@entry=0x7fb2baa19b08) at /data/src/10.2/sql/sql_string.cc:156
#8  0x00007fb2e305b1a7 in Field_blob::store_field (this=0x7fb2baa19a28, from=0x7fb2ba82a288) at /data/src/10.2/sql/field.h:3233
#9  0x00007fb2e305c54d in field_conv_incompatible (to=to@entry=0x7fb2baa19a28, from=from@entry=0x7fb2ba82a288) at /data/src/10.2/sql/field_conv.cc:814
#10 0x00007fb2e305d875 in field_conv (to=to@entry=0x7fb2baa19a28, from=from@entry=0x7fb2ba82a288) at /data/src/10.2/sql/field_conv.cc:827
#11 0x00007fb2e3077666 in save_field_in_field (from=0x7fb2ba82a288, null_value=0x7fb2ba8daa62, to=0x7fb2baa19a28, no_conversions=<optimized out>) at /data/src/10.2/sql/item.cc:6173
#12 0x00007fb2e30776dd in Item_field::save_in_field (this=<optimized out>, to=<optimized out>, no_conversions=<optimized out>) at /data/src/10.2/sql/item.cc:6219
#13 0x00007fb2e2f4f61d in TABLE::update_virtual_field (this=this@entry=0x7fb2ba8d9470, vf=0x7fb2baa19a28) at /data/src/10.2/sql/table.cc:7373
#14 0x00007fb2e3261695 in innobase_get_computed_value (row=row@entry=0x7fb2baa2c128, col=<optimized out>, index=<optimized out>, local_heap=local_heap@entry=0x7fb2e3e76ca0, heap=heap@entry=0x0, ifield=ifield@entry=0x7fb2ba8f0298, thd=0x7fb2ba816070, mysql_table=0x7fb2ba8d9470, old_table=0x7fb2ba965688, parent_update=0x0, foreign=0x0) at /data/src/10.2/storage/innobase/handler/ha_innodb.cc:23810
#15 0x00007fb2e3372084 in row_merge_buf_add (buf=buf@entry=0x7fb2ba84fc08, fts_index=fts_index@entry=0x0, old_table=old_table@entry=0x7fb2ba965688, new_table=new_table@entry=0x7fb2ba965688, psort_info=psort_info@entry=0x0, row=row@entry=0x7fb2baa2c128, ext=0x0, doc_id=0x7fb2e3e76ca8, conv_heap=0x0, err=0x7fb2e3e76c64, v_heap=0x7fb2e3e76ca0, my_table=0x7fb2ba8d9470, trx=0x7fb2d90008e8) at /data/src/10.2/storage/innobase/row/row0merge.cc:693
#16 0x00007fb2e337d3c5 in row_merge_read_clustered_index (eval_table=0x7fb2ba8d9470, crypt_block=0x0, crypt_data=0x0, pct_cost=<optimized out>, stage=0x7fb2ba9f20b0, tmpfd=0x7fb2e3e76c60, skip_pk_sort=<optimized out>, block=0x7fb2da8ff000 <error: Cannot access memory at address 0x7fb2da8ff000>, sequence=..., add_autoinc=18446744073709551615, col_map=0x0, add_v=0x0, add_cols=0x0, n_index=1, key_numbers=0x7fb2ba82a9d8, files=0x7fb2ba8562c0, psort_info=0x0, fts_sort_idx=0x0, index=0x7fb2ba82a9d0, online=true, new_table=<optimized out>, old_table=0x7fb2ba965688, table=0x7fb2ba8d9470, trx=0x7fb2d90008e8) at /data/src/10.2/storage/innobase/row/row0merge.cc:2352
#17 row_merge_build_indexes (trx=0x7fb2d90008e8, old_table=0x7fb2ba965688, new_table=<optimized out>, online=true, indexes=0x7fb2ba82a9d0, key_numbers=0x7fb2ba82a9d8, n_indexes=1, table=0x7fb2ba8d9470, add_cols=0x0, col_map=0x0, add_autoinc=18446744073709551615, sequence=..., skip_pk_sort=false, stage=0x7fb2ba9f20b0, add_v=0x0, eval_table=0x7fb2ba8d9470) at /data/src/10.2/storage/innobase/row/row0merge.cc:4822
#18 0x00007fb2e328a76d in ha_innobase::inplace_alter_table (this=0x7fb2ba8b5088, altered_table=0x7fb2ba8d9470, ha_alter_info=0x7fb2e3e77c50) at /data/src/10.2/storage/innobase/handler/handler0alter.cc:6514
#19 0x00007fb2e2f1c5ea in ha_inplace_alter_table (ha_alter_info=0x7fb2e3e77c50, altered_table=0x7fb2ba8d9470, this=<optimized out>) at /data/src/10.2/sql/handler.h:3744
#20 mysql_inplace_alter_table (thd=thd@entry=0x7fb2ba816070, table_list=0x7fb2ba864180, table=table@entry=0x7fb2ba8d7c70, altered_table=altered_table@entry=0x7fb2ba8d9470, ha_alter_info=ha_alter_info@entry=0x7fb2e3e77c50, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, target_mdl_request=0x7fb2e3e77d30, alter_ctx=0x7fb2e3e78b10) at /data/src/10.2/sql/sql_table.cc:7290
#21 0x00007fb2e2f24132 in mysql_alter_table (thd=thd@entry=0x7fb2ba816070, new_db=<optimized out>, new_name=<optimized out>, create_info=create_info@entry=0x7fb2e3e79710, table_list=table_list@entry=0x7fb2ba864180, alter_info=alter_info@entry=0x7fb2e3e79660, order_num=0, order=0x0, ignore=false) at /data/src/10.2/sql/sql_table.cc:9219
#22 0x00007fb2e2f7f8f9 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7fb2ba816070) at /data/src/10.2/sql/sql_alter.cc:324
#23 0x00007fb2e2e8792b in mysql_execute_command (thd=thd@entry=0x7fb2ba816070) at /data/src/10.2/sql/sql_parse.cc:6116
#24 0x00007fb2e2e892d2 in mysql_parse (thd=thd@entry=0x7fb2ba816070, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fb2e3e7b8e0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:7790
#25 0x00007fb2e2e8b55b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fb2ba816070, packet=packet@entry=0x7fb2ba858071 "ALTER TABLE t3 ADD INDEX(vcol_blob(64))", packet_length=packet_length@entry=39, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:1799
#26 0x00007fb2e2e8e08d in do_command (thd=0x7fb2ba816070) at /data/src/10.2/sql/sql_parse.cc:1359
#27 0x00007fb2e2f7bf4a in do_handle_one_connection (connect=connect@entry=0x7fb2e0071f70) at /data/src/10.2/sql/sql_connect.cc:1354
#28 0x00007fb2e2f7c133 in handle_one_connection (arg=arg@entry=0x7fb2e0071f70) at /data/src/10.2/sql/sql_connect.cc:1260
#29 0x00007fb2e322a1bf in pfs_spawn_thread (arg=0x7fb2cabf44f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#30 0x00007fb2e257d0a4 in start_thread (arg=0x7fb2e3e7d300) at pthread_create.c:309
#31 0x00007fb2e0d9d87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

--source include/have_innodb.inc
 
CREATE TABLE t3 ( 
 pk BIGINT AUTO_INCREMENT,
 col_enum ENUM('','a','b','c','d','e','f','foo','bar') NULL,
 col_char CHAR(58) NOT NULL DEFAULT '',
 col_blob LONGBLOB NOT NULL DEFAULT '',
 col_datetime DATETIME(2) NULL,
 col_bit BIT(54) NULL,
 col_timestamp TIMESTAMP(4) NOT NULL DEFAULT '1971-01-01 00:00:00',
 col_year YEAR NULL,
 col_int BIGINT(24) UNSIGNED NOT NULL DEFAULT 0,
 col_time TIME(5) NOT NULL DEFAULT '00:00:00',
 col_varchar VARBINARY(635) NOT NULL DEFAULT '',
 col_dec DECIMAL(10,5) UNSIGNED ZEROFILL NOT NULL DEFAULT 0,
 col_date DATE NULL,
 vcol_year YEAR AS (col_year) VIRTUAL,
 vcol_char CHAR(164) AS (col_char) VIRTUAL,
 vcol_varchar VARCHAR(2509) AS (col_varchar) VIRTUAL,
 vcol_time TIME(3) AS (col_time) VIRTUAL,
 vcol_date DATE AS (col_date) VIRTUAL,
 vcol_blob BLOB AS (col_blob) VIRTUAL,
 vcol_bit BIT(11) AS (col_bit) VIRTUAL,
 vcol_enum ENUM('','a','b','c','d','e','f','foo','bar') AS (col_enum) VIRTUAL,
 vcol_timestamp TIMESTAMP AS (col_timestamp) VIRTUAL,
 vcol_datetime DATETIME(5) AS (col_datetime) VIRTUAL,
 vcol_dec DECIMAL(7,6) ZEROFILL AS (col_dec) VIRTUAL,
 vcol_int INT(62) AS (col_int) VIRTUAL,
 PRIMARY KEY(pk)
) ENGINE=InnoDB;
 
INSERT INTO t3 (col_enum,col_char,col_blob,col_datetime,col_bit,col_timestamp,col_year,col_int,col_time,col_varchar,col_dec,col_date) VALUES
 (NULL,'f','foo','1983-06-09 13:49:03',b'100','2019-12-24 08:30:45',1972,3,'00:00:00','k',0.2,'1997-02-23');
 
ALTER TABLE t3 ADD INDEX(vcol_blob(64));

Also crashes on a non-debug build.



 Comments   
Comment by Elena Stepanova [ 2017-01-02 ]

Also reproducible on bb-10.2-monty as of 349d69e2e

Comment by Sergei Golubchik [ 2017-02-09 ]

cannot repeat on the latest bb-10.2-serg, probably fixed by 709d9068651
meaning it's a duplicate of MDEV-11604

Generated at Thu Feb 08 07:51:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.