[MDEV-4849] Out of memory error and valgrind warnings on COLUMN_ADD Created: 2013-08-07  Updated: 2013-08-20  Resolved: 2013-08-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.3, 5.5.32
Fix Version/s: 10.0.5, 5.5.33

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Relates

 Description   

The following test case produces the error "Out of memory (Needed 160 bytes)":

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (dyncol tinyblob) ENGINE=MyISAM;
 
INSERT INTO t1 SET dyncol = COLUMN_CREATE( 3, REPEAT('a',330), 4, 'x' );
SELECT COLUMN_ADD( COLUMN_ADD( dyncol, 1, REPEAT('b',130) ), 3, 'y' ) FROM t1;

ERROR HY000: Out of memory (Needed 160 bytes)

and an error in the error log:

Error: Reallocating overrun buffer  mysys/safemalloc.c:164, mysys/my_malloc.c:93, mysys/string.c:84, mysys/ma_dyncol.c:132, mysys/ma_dyncol.c:432, mysys/ma_dyncol.c:854, mysys/ma_dyncol.c:2070, sql/item_strfunc.cc:4024

If it's run with valgrind, it also causes "blocks are still reachable in loss record":

==27020== 244 bytes in 1 blocks are still reachable in loss record 1 of 2
==27020==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27020==    by 0xCCBD62: sf_malloc (safemalloc.c:105)
==27020==    by 0xCB6A53: my_malloc (my_malloc.c:41)
==27020==    by 0xCBF96A: init_dynamic_string (string.c:39)
==27020==    by 0xCD016D: dynamic_column_init_str (ma_dyncol.c:85)
==27020==    by 0xCD330A: dynamic_column_update_many (ma_dyncol.c:1939)
==27020==    by 0x857EFF: Item_func_dyncol_add::val_str(String*) (item_strfunc.cc:4024)
==27020==    by 0x7E86FE: Item::send(Protocol*, String*) (item.cc:6324)
==27020==    by 0x5717B9: Protocol::send_result_set_row(List<Item>*) (protocol.cc:900)
==27020==    by 0x5D7597: select_send::send_data(List<Item>&) (sql_class.cc:2369)
==27020==    by 0x66A05E: end_send(JOIN*, st_join_table*, bool) (sql_select.cc:17432)
==27020==    by 0x666F9F: do_select(JOIN*, List<Item>*, TABLE*, Procedure*) (sql_select.cc:15969)
==27020==    by 0x646F95: JOIN::exec() (sql_select.cc:2834)
==27020==    by 0x647792: mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) (sql_select.cc:3054)
==27020==    by 0x63E349: handle_select(THD*, LEX*, select_result*, unsigned long) (sql_select.cc:318)
==27020==    by 0x617107: execute_sqlcom_select(THD*, TABLE_LIST*) (sql_parse.cc:4651)

bzr version-info

revision-id: elenst@gmail.com-20130805172121-rf6pytcvw2p4rko6
revno: 3844
branch-nick: 5.5

Built with BUILD/compile-pentium-debug-max-no-ndb



 Comments   
Comment by Oleksandr Byelkin [ 2013-08-20 ]

mdev 4811 duplicate

Generated at Thu Feb 08 06:59:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.