Bug #24486 Valgrind warnings: sp_head(), deadlock_innodb:events_grant
Submitted: 21 Nov 2006 21:19 Modified: 28 Nov 2006 21:49
Reporter: Lars Thalmann Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1 OS:
Assigned to: Konstantin Osipov CPU Architecture:Any

[21 Nov 2006 21:19] Lars Thalmann
Description:
Main source tree valgrind warnings related to sp_head():

VALGRIND: '117,087 (1,964 direct, 115,123 indirect) bytes in 5 blocks are definitely lost in loss record 7 of 9'
    COUNT: 1
    FUNCTION: malloc    FILES:    master.err
    TESTS:    deadlock_innodb:events_grant
    STACK: at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x9407EE: my_malloc (my_malloc.c:35)
             by 0x941132: alloc_root (my_alloc.c:154)
             by 0x76ED97: sp_head::operator new(unsigned long) (sp_head.cc:433)
             by 0x61CD14: MYSQLparse(void*) (sql_yacc.yy:1442)
             by 0x617016: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:6020)
             by 0x60E700: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1835)
             by 0x60E1EB: do_command(THD*) (sql_parse.cc:1619)
             by 0x60D5C8: handle_one_connection (sql_parse.cc:1234)
             by 0x4D3AC63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x52F3242: clone (in /lib64/tls/libc-2.3.2.so)

VALGRIND: '96,243 bytes in 125 blocks are indirectly lost in loss record 9 of 9'
    COUNT: 1
    FUNCTION: malloc    FILES:    master.err
    TESTS:    deadlock_innodb:events_grant
    STACK: at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x9407EE: my_malloc (my_malloc.c:35)
             by 0x941132: alloc_root (my_alloc.c:154)
             by 0x9417DD: memdup_root (my_alloc.c:415)
             by 0x776042: sp_head::merge_table_list(THD*, st_table_list*, st_lex*) (sql_class.h:429)
             by 0x771FB7: sp_head::restore_lex(THD*) (sp_head.cc:1871)
             by 0x61DFC5: MYSQLparse(void*) (sql_yacc.yy:2048)
             by 0x617016: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:6020)
             by 0x60E700: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1835)
             by 0x60E1EB: do_command(THD*) (sql_parse.cc:1619)
             by 0x60D5C8: handle_one_connection (sql_parse.cc:1234)
             by 0x4D3AC63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x52F3242: clone (in /lib64/tls/libc-2.3.2.so)

VALGRIND: '18,880 bytes in 5 blocks are indirectly lost in loss record 8 of 9'
    COUNT: 1
    FUNCTION: malloc    FILES:    master.err
    TESTS:    deadlock_innodb:events_grant
    STACK: at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x771D36: sp_head::reset_lex(THD*) (sp_head.cc:1798)
             by 0x61E3C9: MYSQLparse(void*) (sql_yacc.yy:2221)
             by 0x617016: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:6020)
             by 0x60E700: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1835)
             by 0x60E1EB: do_command(THD*) (sql_parse.cc:1619)
             by 0x60D5C8: handle_one_connection (sql_parse.cc:1234)
             by 0x4D3AC63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x52F3242: clone (in /lib64/tls/libc-2.3.2.so)

How to repeat:
Check pushbuild
[23 Nov 2006 5:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/15746

ChangeSet@1.2371, 2006-11-23 06:57:24+01:00, mats@romeo.(none) +1 -0
  BUG#24486 (valgrind warning: write(buf) points to uninitialized bytes):
  Patch to fix valgrind warning that uninitialized bytes were written. 
  The warning was caused by set_default(), which assumes that the field pointer is pointing
  into record[0], while all other functions honors the move_field_offset().
[23 Nov 2006 9:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/15748

ChangeSet@1.2371, 2006-11-23 10:09:39+01:00, mats@romeo.(none) +1 -0
  BUG#24486 (valgrind warning: write(buf) points to uninitialized bytes):
  Patch to fix valgrind warning that uninitialized bytes were written. 
  The warning was caused by set_default(), which assumes that the field pointer is pointing
  into record[0], while all other functions honors the move_field_offset().
[23 Nov 2006 9:16] Mats Kindahl
Patches submitted to bug was actually for BUG#24533.
[27 Nov 2006 15:13] Konstantin Osipov
Was not able to repeat the bug on my host. Trying nocona.
[27 Nov 2006 15:57] Konstantin Osipov
OK, the memory leak is in events_bugs.test, I was able to reproduce it on nocona and my host.
[28 Nov 2006 17:54] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/16000

ChangeSet@1.2374, 2006-11-28 20:52:48+03:00, kostja@bodhi.local +1 -0
  A fix for Bug#24486 "Valgrind warnings: sp_head(), 
  deadlock_innodb:events_grant". This was a memory leak introduced by 
  the patch for Bug 22830
[28 Nov 2006 18:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/16012

ChangeSet@1.2374, 2006-11-28 21:35:20+03:00, kostja@bodhi.local +1 -0
  A fix for Bug#24486 "Valgrind warnings: sp_head(), 
  deadlock_innodb:events_grant". This was a memory leak introduced by 
  the patch for Bug 22830.
  Post-review fixes.
[28 Nov 2006 21:49] Konstantin Osipov
Pushed into 5.1-main tree.
No documentation entry needed.