Bug #46570 | test udf fails with valgrind | ||
---|---|---|---|
Submitted: | 5 Aug 2009 16:11 | Modified: | 2 Apr 2010 18:01 |
Reporter: | Marc ALFF | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 6.0-codebase, 5.5.99-m3 | OS: | Linux (suse 11.0) |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[5 Aug 2009 16:11]
Marc ALFF
[6 Aug 2009 5:51]
Sveta Smirnova
Thank you for the report. Verified as described: Version: '5.4.4-alpha-debug-log' socket: '/users/ssmirnova/blade12/src/mysql-azalea/mysql-test/var/tmp/mysqld.1.sock' port: 13000 Source distribution ==17160== Thread 3: ==17160== Syscall param pwrite64(buf) points to uninitialised byte(s) ==17160== at 0x3429E0D708: (within /lib64/libpthread-2.5.so) ==17160== by 0xB1FF6D: my_pwrite (my_pread.c:162) ==17160== by 0xB21191: key_cache_pwrite (mf_keycache.c:803) ==17160== by 0xB26217: flush_cached_blocks (mf_keycache.c:3554) ==17160== by 0xB268F4: flush_key_blocks_int (mf_keycache.c:3850) ==17160== by 0xB26E5B: flush_key_blocks (mf_keycache.c:4107) ==17160== by 0xA4A017: mi_lock_database (mi_locking.c:74) ==17160== by 0xA31EFF: ha_myisam::external_lock(THD*, int) (ha_myisam.cc:1805) ==17160== by 0x8295D4: handler::ha_external_lock(THD*, int) (handler.cc:5475) ==17160== by 0x6B7A54: unlock_external(THD*, TABLE**, unsigned int) (lock.cc:822) ==17160== by 0x6B6C39: mysql_unlock_tables(THD*, st_mysql_lock*) (lock.cc:437) ==17160== by 0x7249D6: close_thread_tables(THD*, bool) (sql_base.cc:1466) ==17160== by 0x6CF75B: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1411) ==17160== by 0x6CD819: do_command(THD*) (sql_parse.cc:743) ==17160== by 0x6CBFE5: handle_one_connection (sql_connect.cc:1158) ==17160== by 0x3429E061B4: start_thread (in /lib64/libpthread-2.5.so) ==17160== Address 0x533aff2 is 2,106 bytes inside a block of size 850,988 alloc'd ==17160== at 0x4A075EE: malloc (vg_replace_malloc.c:207) ==17160== by 0xB2D91F: _mymalloc (safemalloc.c:147) ==17160== by 0xB499E8: my_large_malloc (my_largepage.c:64) ==17160== by 0xB20714: init_key_cache (mf_keycache.c:439) ==17160== by 0x825A45: ha_init_key_cache (handler.cc:3678) ==17160== by 0x6E83E0: process_key_caches(int (*)(char const*, st_key_cache*)) (set_var.cc:4820) ==17160== by 0x6C1C1A: init_server_components() (mysqld.cc:4120) ==17160== by 0x6C277C: main (mysqld.cc:4634) ==17160== ==17160== Conditional jump or move depends on uninitialised value(s) ==17160== at 0x60784B: String::c_ptr() (sql_string.h:98) ==17160== by 0x61663A: udf_handler::fix_fields(THD*, Item_result_field*, unsigned int, Item**) (item_func.cc:3015) ==17160== by 0x621A4A: Item_udf_func::fix_fields(THD*, Item**) (item_func.h:1041) ==17160== by 0x8BDEDD: sp_prepare_func_item(THD*, Item**) (sp_head.cc:309) ==17160== by 0x5EFCAF: Item_trigger_field::set_value(THD*, sp_rcontext*, Item**) (item.cc:6916) ==17160== by 0x8C70C9: Item_trigger_field::set_value(THD*, Item**) (item.h:2956) ==17160== by 0x8C4C14: sp_instr_set_trigger_field::exec_core(THD*, unsigned int*) (sp_head.cc:3020) ==17160== by 0x8C42D6: sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*) (sp_head.cc:2755) ==17160== by 0x8C4BD9: sp_instr_set_trigger_field::execute(THD*, unsigned int*) (sp_head.cc:3013) ==17160== by 0x8C0955: sp_head::execute(THD*) (sp_head.cc:1250) ==17160== by 0x8C149C: sp_head::execute_trigger(THD*, st_mysql_lex_string const*, st_mysql_lex_string const*, st_grant_info*) (sp_head.cc:1561) ==17160== by 0x8D6638: Table_triggers_list::process_triggers(THD*, trg_event_type, trg_action_time_type, bool) (sql_trigger.cc:2012) ==17160== by 0x730EEC: fill_record_n_invoke_before_triggers(THD*, Field**, List<Item>&, bool, Table_triggers_list*, trg_event_type) (sql_base.cc:7518) ==17160== by 0x77D985: mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:800) ==17160== by 0x6D39E0: mysql_execute_command(THD*) (sql_parse.cc:3220) ==17160== by 0x8C48A7: sp_instr_stmt::exec_core(THD*, unsigned int*) (sp_head.cc:2931)
[10 Sep 2009 9:16]
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/82903 2814 Alexey Botchkov 2009-09-10 Bug#46570 test udf fails with valgrind the value obtained by String::c_ptr() method not always has the ending zero. The String::c_ptr_safe() is more correct here. per-file comments: sql/item_func.cc Bug#46570 test udf fails with valgrind c_ptr_safe() used for UDF parameters as the library expects zero-ending strings.
[1 Oct 2009 14:23]
Kristofer Pettersson
Alexey: Do you think you could describe what caused the valgrind error to show ? Where does the udf subsystem require 0-terminated strings?
[8 Oct 2009 11:24]
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/86132 2814 Alexey Botchkov 2009-10-08 Bug#46570 test udf fails with valgrind the value obtained by String::c_ptr() method not always has the ending zero. Particularly in this bug the dlsym() expects zero-ending string. The String::c_ptr_safe() is more correct here. per-file comments: sql/item_func.cc Bug#46570 test udf fails with valgrind c_ptr_safe() used for UDF parameters as the library expects zero-ending strings.
[23 Dec 2009 13:08]
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/95536 2948 Alexey Botchkov 2009-12-22 Bug#46570 test udf fails with valgrind the value obtained by String::c_ptr() method not always has the ending zero. Particularly in this bug the dlsym() expects zero-ending string. The String::c_ptr_safe() is more correct here. per-file comments: sql/item_func.cc Bug#46570 test udf fails with valgrind c_ptr_safe() used for UDF parameters as the library expects zero-ending strings.
[23 Dec 2009 13:45]
Alexey Botchkov
pushed into mysql-next-mr-bugfixing
[6 Mar 2010 10:57]
Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:guilhem@mysql.com-20100108092756-k0zzf4kvx9b7bh38) (merge vers: 6.0.14-alpha) (pib:16)
[2 Apr 2010 18:01]
Paul DuBois
Noted in 5.5.3 changelog. Valgrind warnings about memory allocation overruns for handling CREATE FUNCTION statements for UDFs were corrected.