[MDEV-11023] Assertion `(longlong) thd->status_var.memory_used >= 0' failed in void my_malloc_size_cb_func(long long int, my_bool) Created: 2016-10-11  Updated: 2023-12-09  Resolved: 2023-12-09

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.0, 10.1
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

It might be a duplicate of MDEV-10711, but the location of the failure is different, so I'm filing it separately.
Not reproducible on 10.2.

CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY);
 
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL);
INSERT INTO t1 SELECT NULL FROM t1;
INSERT INTO t1 SELECT NULL FROM t1;
INSERT INTO t1 SELECT NULL FROM t1;
INSERT INTO t1 SELECT NULL FROM t1;
INSERT INTO t1 SELECT NULL FROM t1;
INSERT INTO t1 SELECT NULL FROM t1;
INSERT INTO t1 SELECT NULL FROM t1;
 
--connect (con2,localhost,root,,test)
CREATE TABLE t2 AS SELECT 1 AS j;
--connection default
SELECT ( SELECT DISTINCT BENCHMARK(1, 1) FROM t1 GROUP BY USER() WITH ROLLUP ) AS s1;
--connection con2
UPDATE t2 SET j = ( SELECT DISTINCT i FROM t1 );

10.0 b34d7fba31

mysqld: /data/src/10.0/sql/mysqld.cc:3877: void my_malloc_size_cb_func(long long int, my_bool): Assertion `(longlong) thd->status_var.memory_used >= 0' failed.
161011 19:01:00 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f0f03cb0312 in __GI___assert_fail (assertion=0xe6fe20 "(longlong) thd->status_var.memory_used >= 0", file=0xe6eae4 "/data/src/10.0/sql/mysqld.cc", line=3877, function=0xe76480 <my_malloc_size_cb_func::__PRETTY_FUNCTION__> "void my_malloc_size_cb_func(long long int, my_bool)") at assert.c:101
#8  0x000000000058c19f in my_malloc_size_cb_func (size=-155560, is_thread_specific=1 '\001') at /data/src/10.0/sql/mysqld.cc:3877
#9  0x0000000000e18513 in update_malloc_size (size=-155560, is_thread_specific=1 '\001') at /data/src/10.0/mysys/my_malloc.c:67
#10 0x0000000000e18a2b in my_free (ptr=0x7f0efc5cb070) at /data/src/10.0/mysys/my_malloc.c:215
#11 0x00000000009c83b6 in Filesort_buffer::free_sort_buffer (this=0x7f0efc49ed70) at /data/src/10.0/sql/filesort_utils.cc:119
#12 0x00000000008309a2 in Filesort_info::free_sort_buffer (this=0x7f0efc49ed70) at /data/src/10.0/sql/table.h:361
#13 0x000000000082c60d in filesort_free_buffers (table=0x7f0efc49e470, full=true) at /data/src/10.0/sql/filesort.cc:447
#14 0x0000000000699344 in JOIN::cleanup (this=0x7f0efc0cf088, full=true) at /data/src/10.0/sql/sql_select.cc:11720
#15 0x0000000000699042 in JOIN::join_free (this=0x7f0efc0cf088) at /data/src/10.0/sql/sql_select.cc:11642
#16 0x00000000006a6dc8 in do_select (join=0x7f0efc0cf088, fields=0x7f0efc0229b0, table=0x0, procedure=0x0) at /data/src/10.0/sql/sql_select.cc:17537
#17 0x0000000000683d40 in JOIN::exec_inner (this=0x7f0efc0cf088) at /data/src/10.0/sql/sql_select.cc:3084
#18 0x0000000000681216 in JOIN::exec (this=0x7f0efc0cf088) at /data/src/10.0/sql/sql_select.cc:2373
#19 0x00000000008d7e13 in subselect_single_select_engine::exec (this=0x7f0efc023b78) at /data/src/10.0/sql/item_subselect.cc:3701
#20 0x00000000008ced7f in Item_subselect::exec (this=0x7f0efc023a38) at /data/src/10.0/sql/item_subselect.cc:674
#21 0x00000000008d0505 in Item_singlerow_subselect::val_int (this=0x7f0efc023a38) at /data/src/10.0/sql/item_subselect.cc:1254
#22 0x0000000000852d6b in Item::save_in_field (this=0x7f0efc023a38, field=0x7f0efc0551a8, no_conversions=false) at /data/src/10.0/sql/item.cc:6089
#23 0x00000000005f3685 in fill_record (thd=0x7f0efde90070, table_arg=0x7f0efc09cc70, fields=..., values=..., ignore_errors=false) at /data/src/10.0/sql/sql_base.cc:8705
#24 0x00000000005f38bc in fill_record_n_invoke_before_triggers (thd=0x7f0efde90070, table=0x7f0efc09cc70, fields=..., values=..., ignore_errors=false, event=TRG_EVENT_UPDATE) at /data/src/10.0/sql/sql_base.cc:8761
#25 0x0000000000711c1e in mysql_update (thd=0x7f0efde90070, table_list=0x7f0efc022190, fields=..., values=..., conds=0x0, order_num=0, order=0x0, limit=18446744073709551615, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7f0f05f2c300, updated_return=0x7f0f05f2c2f8) at /data/src/10.0/sql/sql_update.cc:757
#26 0x000000000064941b in mysql_execute_command (thd=0x7f0efde90070) at /data/src/10.0/sql/sql_parse.cc:3313
#27 0x0000000000651e18 in mysql_parse (thd=0x7f0efde90070, rawbuf=0x7f0efc022088 "UPDATE t2 SET j = ( SELECT DISTINCT i FROM t1 )", length=47, parser_state=0x7f0f05f2c650) at /data/src/10.0/sql/sql_parse.cc:6576
#28 0x0000000000644918 in dispatch_command (command=COM_QUERY, thd=0x7f0efde90070, packet=0x7f0efde96071 "UPDATE t2 SET j = ( SELECT DISTINCT i FROM t1 )", packet_length=47) at /data/src/10.0/sql/sql_parse.cc:1309
#29 0x0000000000643bdb in do_command (thd=0x7f0efde90070) at /data/src/10.0/sql/sql_parse.cc:999
#30 0x0000000000761efa in do_handle_one_connection (thd_arg=0x7f0efde90070) at /data/src/10.0/sql/sql_connect.cc:1378
#31 0x0000000000761c6c in handle_one_connection (arg=0x7f0efde90070) at /data/src/10.0/sql/sql_connect.cc:1293
#32 0x00000000009faa88 in pfs_spawn_thread (arg=0x7f0efdd91870) at /data/src/10.0/storage/perfschema/pfs.cc:1860
#33 0x00007f0f05bb20a4 in start_thread (arg=0x7f0f05f2d700) at pthread_create.c:309
#34 0x00007f0f03d6a87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111



 Comments   
Comment by Elena Stepanova [ 2023-12-09 ]

10.1 has been long EOL.

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