We're updating the issue view to help you get more done. 

Multi-source: "Freeing overrun buffer" error and valgrind warnings on change master with a named connection

Description

The minimal test case requires only one command, CHANGE MASTER for a named connection (no errors on an anonymous connection)

cat suite/multi_source/memory_issue.test

1 2 3 4 eval change master 'slave1' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';

If it's run in MTR just as ./mtr multi_source.memory_issue, it produces an error
Error: Freeing overrun buffer

If it's run with valgrind, as ./mtr --valgrind-mysqld multi_source.memory_issue, it produces valgrind warnings:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 line ==9413== Thread 5: ==9413== Invalid write of size 1 ==9413== at 0x4C2781D: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0x7220FD: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:56) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba3 is 1 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid write of size 1 ==9413== at 0x4C27827: memcpy (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0x7220FD: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:56) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid read of size 1 ==9413== at 0xC9D558: my_casedn_str_utf8 (ctype-utf8.c:2583) ==9413== by 0x72212F: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:57) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid read of size 1 ==9413== at 0xC9CBF8: my_utf8_uni_no_range (ctype-utf8.c:2368) ==9413== by 0xC9D575: my_casedn_str_utf8 (ctype-utf8.c:2583) ==9413== by 0x72212F: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:57) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid write of size 1 ==9413== at 0xC9CE9A: my_uni_utf8_no_range (ctype-utf8.c:2472) ==9413== by 0xC9D535: my_casedn_str_utf8 (ctype-utf8.c:2588) ==9413== by 0x72212F: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:57) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid write of size 1 ==9413== at 0xC9D58A: my_casedn_str_utf8 (ctype-utf8.c:2609) ==9413== by 0x72212F: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:57) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba3 is 1 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid read of size 1 ==9413== at 0xC9D066: my_hash_sort_utf8 (ctype-utf8.c:2513) ==9413== by 0xC413FB: calc_hash (hash.c:46) ==9413== by 0xC41922: my_hash_first (hash.c:251) ==9413== by 0xC41844: my_hash_search (hash.c:219) ==9413== by 0xC41CD4: my_hash_insert (hash.c:387) ==9413== by 0x7246E6: Master_info_index::add_master_info(Master_info*, bool) (rpl_mi.cc:950) ==9413== by 0x65B1E5: change_master(THD*, Master_info*) (sql_repl.cc:1722) ==9413== by 0x62FD8F: mysql_execute_command(THD*) (sql_parse.cc:2372) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid read of size 1 ==9413== at 0xC9CA9C: my_utf8_uni (ctype-utf8.c:2261) ==9413== by 0xC9D1A6: my_hash_sort_utf8 (ctype-utf8.c:2516) ==9413== by 0xC413FB: calc_hash (hash.c:46) ==9413== by 0xC41922: my_hash_first (hash.c:251) ==9413== by 0xC41844: my_hash_search (hash.c:219) ==9413== by 0xC41CD4: my_hash_insert (hash.c:387) ==9413== by 0x7246E6: Master_info_index::add_master_info(Master_info*, bool) (rpl_mi.cc:950) ==9413== by 0x65B1E5: change_master(THD*, Master_info*) (sql_repl.cc:1722) ==9413== by 0x62FD8F: mysql_execute_command(THD*) (sql_parse.cc:2372) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid read of size 1 ==9413== at 0xC9D066: my_hash_sort_utf8 (ctype-utf8.c:2513) ==9413== by 0xC413FB: calc_hash (hash.c:46) ==9413== by 0xC4180D: rec_hashnr (hash.c:212) ==9413== by 0xC41FA9: my_hash_insert (hash.c:478) ==9413== by 0x7246E6: Master_info_index::add_master_info(Master_info*, bool) (rpl_mi.cc:950) ==9413== by 0x65B1E5: change_master(THD*, Master_info*) (sql_repl.cc:1722) ==9413== by 0x62FD8F: mysql_execute_command(THD*) (sql_parse.cc:2372) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Invalid read of size 1 ==9413== at 0xC9CA9C: my_utf8_uni (ctype-utf8.c:2261) ==9413== by 0xC9D1A6: my_hash_sort_utf8 (ctype-utf8.c:2516) ==9413== by 0xC413FB: calc_hash (hash.c:46) ==9413== by 0xC4180D: rec_hashnr (hash.c:212) ==9413== by 0xC41FA9: my_hash_insert (hash.c:478) ==9413== by 0x7246E6: Master_info_index::add_master_info(Master_info*, bool) (rpl_mi.cc:950) ==9413== by 0x65B1E5: change_master(THD*, Master_info*) (sql_repl.cc:1722) ==9413== by 0x62FD8F: mysql_execute_command(THD*) (sql_parse.cc:2372) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ==9413== Address 0x1164eba2 is 0 bytes after a block of size 114 alloc'd ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so) ^ Found warnings in /home/elenst/10.0-mdev253/mysql-test/var/log/mysqld.1.err ok - saving '/home/elenst/10.0-mdev253/mysql-test/var/log/multi_source.memory_issue/' to '/home/elenst/10.0-mdev253/mysql-test/var/log/multi_source.memory_issue/' ***Warnings generated in error logs during shutdown after running tests: multi_source.memory_issue Error: Freeing overrun buffer mysys/safemalloc.c:179, mysys/my_malloc.c:116, sql/rpl_mi.cc:76, sql/rpl_mi.cc:84, sql/rpl_mi.cc:596, mysys/hash.c:115, mysys/hash.c:139, sql/rpl_mi.cc:674 Error: Safemalloc overrun buffer mysys/safemalloc.c:303, mysys/safemalloc.c:325, ??:0, ??:0, sql/mysqld.cc:1758, sql/mysqld.cc:5022, sql/main.cc:26, ??:0 Warning: 14 bytes lost, allocated at sql/rpl_mi.cc:48, sql/sql_parse.cc:2361, sql/sql_parse.cc:5813, sql/sql_parse.cc:1071, sql/sql_parse.cc:808, sql/sql_connect.cc:1253, sql/sql_connect.cc:1169, perfschema/pfs.cc:1017 ==9413== Thread 1: ==9413== 114 bytes in 1 blocks are still reachable in loss record 2 of 3 ==9413== at 0x4C26C3A: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==9413== by 0xC797E2: sf_malloc (safemalloc.c:105) ==9413== by 0xC64263: my_malloc (my_malloc.c:41) ==9413== by 0x72205A: Master_info::Master_info(st_mysql_lex_string*, bool) (rpl_mi.cc:49) ==9413== by 0x62FD05: mysql_execute_command(THD*) (sql_parse.cc:2361) ==9413== by 0x6393F2: mysql_parse(THD*, char*, unsigned int, Parser_state*) (sql_parse.cc:5813) ==9413== by 0x62CC5A: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:1069) ==9413== by 0x62BF30: do_command(THD*) (sql_parse.cc:808) ==9413== by 0x72BC14: do_handle_one_connection(THD*) (sql_connect.cc:1253) ==9413== by 0x72B6BC: handle_one_connection (sql_connect.cc:1168) ==9413== by 0xAD763B: pfs_spawn_thread (pfs.cc:1015) ==9413== by 0x4E32A4E: start_thread (in /lib64/libpthread-2.11.2.so) ==9413== by 0x60EE82C: clone (in /lib64/libc-2.11.2.so)

I have also attached the trace file (gzipped), and set up the test on perro.askmonty.org where the problem is reproducible. It's in /home/elenst/10.0-mdev253/, just go there and run the test multi_source.memory_issue. You can do whatever you need with this basedir.
The same mysqld.trace that is attached to this task is also there in /home/elenst/10.0-mdev253/mysql-test/mysqld.trace

Environment

Ubuntu 11.10 x86_64, openSUSE 11.3 x86_64

Status

Assignee

Michael Widenius

Reporter

Elena Stepanova

Priority

Major