Bug #24044 valgrind errors for mysqld + bdb
Submitted: 7 Nov 2006 15:14 Modified: 16 Nov 2006 20:54
Reporter: Magnus Blåudd Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: BDB Severity:S2 (Serious)
Version:5.0.29 OS:
Assigned to: CPU Architecture:Any

[7 Nov 2006 15:14] Magnus Blåudd
Description:
Several valgrind warnings detected when running the bdb tests in valgrind.

How to repeat:
VALGRIND: '64 bytes in 1 blocks are definitely lost in loss record 4 of 7'
    COUNT: 1
    FUNCTION: malloc    FILES:    master.err
    TESTS:    ps_10nestset:ps_6bdb
    STACK: at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x746FF2: __os_umalloc (os_alloc.c:83)
             by 0x79401B: __usermem (log_archive.c:457)
             by 0x793666: __log_archive (log_archive.c:209)
             by 0x6803CA: berkeley_show_logs(Protocol*) (ha_berkeley.cc:294)
             by 0x6B9F11: mysqld_show_logs(THD*) (sql_show.cc:567)
             by 0x5C782A: mysql_execute_command(THD*) (sql_parse.cc:3620)
             by 0x624ECB: Prepared_statement::execute(String*, bool) (sql_prepare.cc:2970)
             by 0x6235FD: mysql_sql_stmt_execute(THD*) (sql_prepare.cc:2332)
             by 0x5CB0E5: mysql_execute_command(THD*) (sql_parse.cc:2610)
             by 0x5CD254: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5809)
             by 0x5C4AB8: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1773)
             by 0x5C449C: do_command(THD*) (sql_parse.cc:1557)
             by 0x5C395C: handle_one_connection (sql_parse.cc:1188)
             by 0x4E54C63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x540D242: clone (in /lib64/tls/libc-2.3.2.so)

VALGRIND: '1,568 bytes in 4 blocks are definitely lost in loss record 6 of 7'
    COUNT: 1
    FUNCTION: malloc    FILES:    master.err
    TESTS:    bdb-alter-table-2:bdb
    STACK: at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x746FF2: __os_umalloc (os_alloc.c:83)
             by 0x75DCA4: __txn_stat (txn_stat.c:61)
             by 0x684D9D: ha_berkeley::analyze(THD*, st_ha_check_opt*) (ha_berkeley.cc:2274)
             by 0x6B1A98: mysql_admin_table(THD*, st_table_list*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned, int (*)(THD*, st_table_list*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, st_table_list*)) (sql_table.cc:2335)
             by 0x6AA12B: mysql_optimize_table(THD*, st_table_list*, st_ha_check_opt*) (sql_table.cc:2558)
             by 0x5C8D88: mysql_execute_command(THD*) (log_event.h:793)
             by 0x5CD254: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5809)
             by 0x5C4AB8: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1773)
             by 0x5C449C: do_command(THD*) (sql_parse.cc:1557)
             by 0x5C395C: handle_one_connection (sql_parse.cc:1188)
             by 0x4E54C63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x540D242: clone (in /lib64/tls/libc-2.3.2.so)

VALGRIND: 'Syscall param write(buf) points to uninitialised byte(s)'
    COUNT: 1
    FUNCTION: (within    FILES:    master.err
    TESTS:    bdb
    STACK: at 0x4E59ADF: (within /lib64/tls/libpthread-0.60.so)
             by 0x748211: __os_write (os_rw.c:144)
             by 0x7437AB: __log_write (log_put.c:998)
             by 0x74334D: __log_flush_int (log_put.c:782)
             by 0x7427C8: __log_flush_commit (log_put.c:374)
             by 0x74255C: __log_put (log_put.c:202)
             by 0x75AEB1: __txn_regop_log (txn_auto.c:93)
             by 0x75964A: __txn_commit (txn.c:541)
             by 0x75AA59: txn_commit (txn.c:151)
             by 0x67FFA3: berkeley_commit(THD*, bool) (ha_berkeley.cc:261)
             by 0x675478: ha_commit_one_phase(THD*, bool) (handler.cc:756)
             by 0x67519C: ha_commit_trans(THD*, bool) (handler.cc:726)
             by 0x6757A6: ha_autocommit_or_rollback(THD*, int) (handler.cc:865)
             by 0x61C632: mysql_insert(THD*, st_table_list*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:662)
             by 0x5C8438: mysql_execute_command(THD*) (sql_parse.cc:3375)
             by 0x5CD254: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5809)
           Address 0x9AEEB8B is 73,555 bytes inside a block of size 98,313 alloc'd
             at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x74729F: __os_malloc (os_alloc.c:269)
             by 0x747D77: __os_r_attach (os_region.c:71)
             by 0x72CA22: __db_r_attach (env_region.c:956)
             by 0x7408FF: __log_open (log.c:59)
             by 0x72906B: __dbenv_open (env_open.c:245)
             by 0x67FDF9: berkeley_init() (ha_berkeley.cc:196)
             by 0x674BC1: ha_init() (handler.cc:503)
             by 0x5B151B: init_server_components() (mysqld.cc:3125)
             by 0x5AE909: main (mysqld.cc:3451)

VALGRIND: 'Conditional jump or move depends on uninitialised value(s)'
    COUNT: 1
    FUNCTION: __log_putr    FILES:    master.err
    TESTS:    bdb
    STACK: at 0x742B26: __log_putr (log_put.c:568)
             by 0x74243A: __log_put (log_put.c:142)
             by 0x771D40: __db_addrem_log (db_auto.c:154)
             by 0x77B83C: __db_pitem (db_dup.c:135)
             by 0x7A1385: __bam_ovput (bt_put.c:853)
             by 0x7A02C4: __bam_iitem (bt_put.c:344)
             by 0x79D89C: __bam_c_put (bt_cursor.c:1945)
             by 0x776E2C: __db_c_put (db_cam.c:1434)
             by 0x7706A9: __db_put (db_am.c:650)
             by 0x681B1B: ha_berkeley::write_row(char*) (ha_berkeley.cc:978)
             by 0x61D886: write_record(THD*, st_table*, st_copy_info*) (sql_insert.cc:1212)
             by 0x61CAE3: mysql_insert(THD*, st_table_list*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:591)
             by 0x5C8438: mysql_execute_command(THD*) (sql_parse.cc:3375)
             by 0x5CD254: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5809)
             by 0x5C4AB8: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1773)
             by 0x5C449C: do_command(THD*) (sql_parse.cc:1557)

VALGRIND: 'Syscall param pwrite64(buf) points to uninitialised byte(s)'
    COUNT: 1
    FUNCTION: (within    FILES:    master.err
    TESTS:    bdb
    STACK: at 0x4E5A90C: (within /lib64/tls/libpthread-0.60.so)
             by 0x748058: __os_io (os_rw.c:49)
             by 0x79659E: __memp_pgwrite (mp_bh.c:402)
             by 0x795D96: __memp_bhwrite (mp_bh.c:160)
             by 0x7465AC: __memp_sync_int (mp_sync.c:427)
             by 0x7716BC: __db_sync (db_am.c:832)
             by 0x76F763: __db_refresh (db.c:751)
             by 0x76F1A3: __db_close_i (db.c:653)
             by 0x685C17: free_share(st_berkeley_share*, st_table*, unsigned, bool) (ha_berkeley.cc:2489)
             by 0x68110D: ha_berkeley::close() (ha_berkeley.cc:714)
             by 0x5F4DB0: closefrm(st_table*) (table.cc:999)
             by 0x5E8561: intern_close_table(st_table*) (sql_base.cc:210)
             by 0x5EFEC1: free_cache_entry(st_table*) (sql_base.cc:229)
             by 0x93AC35: hash_delete (hash.c:520)
             by 0x5EFA60: remove_table_from_cache(THD*, char const*, char const*, unsigned) (sql_base.cc:5314)
             by 0x5A9F77: lock_table_name(THD*, st_table_list*) (lock.cc:902)
           Address 0xCC97A58 is 8,321,576 bytes inside a block of size 10,493,961 alloc'd
             at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x74729F: __os_malloc (os_alloc.c:269)
             by 0x747D77: __os_r_attach (os_region.c:71)
             by 0x72CA22: __db_r_attach (env_region.c:956)
             by 0x744283: __memp_open (mp_region.c:75)
             by 0x729082: __dbenv_open (env_open.c:228)
             by 0x67FDF9: berkeley_init() (ha_berkeley.cc:196)
             by 0x674BC1: ha_init() (handler.cc:503)
             by 0x5B151B: init_server_components() (mysqld.cc:3125)
             by 0x5AE909: main (mysqld.cc:3451)
[16 Nov 2006 20:54] Timothy Smith
Because these are Valgrind warnings in the Berkeley DB code itself, not in the MySQL handler interface to BDB, there's no need for us to try to track them down.