I had an interesting IRC discussion the other day with Monty Taylor about what turned out to be a limitation in Valgrind with respect to debugging memory leaks in dynamically loaded plugins.
Monty Taylor's original problem was with Drizzle, but as it turns out, it is common to all of the MySQL-derived code bases. When there is a memory leak from an allocation in a dynamically loaded plugin, Valgrind will detect the leak, but the part of the stack trace that is within the plugin shows up as an unhelpful three question marks "???":
==1287== 400 bytes in 4 blocks are definitely lost in loss record 5 of 8 ==1287== at 0x4C22FAB: malloc (vg_replace_malloc.c:207) ==1287== by 0x126A2186: ??? ==1287== by 0x7C8E01: ha_initialize_handlerton(st_plugin_int*) (handler.cc:429) ==1287== by 0x88ADD6:[Read more...]