← Back to team overview

enterprise-support team mailing list archive

[Bug 1386157] [NEW] Memory leaks in gen_lex_hash.cc

 

Public bug reported:

Duplicating the upstream report http://bugs.mysql.com/bug.php?id=74540
since it also affects PXB ASAN builds:

When creating an AddressSanitizer/LeakSanitizer (i.e. -DWITH_ASAN=on)
enabled server build on Ubuntu Utopic, the following memory leaks are
reported in gen_lex_hash.cc:

18:01:03 
18:01:03 =================================================================
18:01:03 ==17392==ERROR: LeakSanitizer: detected memory leaks
18:01:03 
18:01:03 Direct leak of 13792 byte(s) in 1 object(s) allocated from:
18:01:03     #0 0x7f879d6b2a96 in __interceptor_realloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x57a96)
18:01:03     #1 0x401ab9 in add_struct_to_map(hash_lex_struct*) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:239
18:01:03     #2 0x401d5b in add_structs_to_map(hash_lex_struct*, int) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:261
18:01:03     #3 0x401dd6 in add_structs_to_map(hash_lex_struct*, int) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:265
18:01:03     #4 0x401dd6 in add_structs_to_map(hash_lex_struct*, int) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:265
18:01:03     #5 0x401dd6 in add_structs_to_map(hash_lex_struct*, int) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:265
18:01:03     #6 0x401dd6 in add_structs_to_map(hash_lex_struct*, int) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:265
18:01:03     #7 0x401dd6 in add_structs_to_map(hash_lex_struct*, int) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:265
18:01:03     #8 0x401dd6 in add_structs_to_map(hash_lex_struct*, int) /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:265
18:01:03     #9 0x4021a0 in print_find_structs() /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:310
18:01:03     #10 0x400ca2 in main /mnt/workspace/percona-xtrabackup-2.2-param/BUILD_TYPE/release/Host/asan/xtrabackuptarget/innodb55/sql/gen_lex_hash.cc:394
18:01:03     #11 0x7f879d2b7ec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
18:01:03 
18:01:03 SUMMARY: AddressSanitizer: 13792 byte(s) leaked in 1 allocation(s).
18:01:03 sql/CMakeFiles/GenServerSource.dir/build.make:61: recipe for target 'sql/lex_hash.h' failed

Indeed, there's a number of malloc()/realloc() calls, but the allocated
memory is never freed. This becomes a problem, because gen_lex_hash is
executed as a part of the build process.

How to repeat:
Build with the "-DWITH_ASAN=on" CMake flag on a Ubuntu Utopic machine. I'm not sure if the leak sanitizer is enabled by default, so "export ASAN_OPTIONS=detect_leaks=1" may also be necessary.

** Affects: mysql-server
     Importance: Unknown
         Status: Unknown

** Affects: percona-xtrabackup
     Importance: Medium
     Assignee: Alexey Kopytov (akopytov)
         Status: Triaged

** Affects: percona-xtrabackup/2.2
     Importance: Medium
     Assignee: Alexey Kopytov (akopytov)
         Status: Triaged

** Also affects: percona-xtrabackup/2.2
   Importance: Undecided
       Status: New

** Changed in: percona-xtrabackup/2.2
       Status: New => Triaged

** Changed in: percona-xtrabackup/2.2
   Importance: Undecided => Medium

** Changed in: percona-xtrabackup/2.2
     Assignee: (unassigned) => Alexey Kopytov (akopytov)

** Changed in: percona-xtrabackup/2.2
    Milestone: None => 2.2.6

** Bug watch added: MySQL Bug System #74540
   http://bugs.mysql.com/bug.php?id=74540

** Also affects: mysql-server via
   http://bugs.mysql.com/bug.php?id=74540
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Server/Client Support Team, which is subscribed to MySQL.
Matching subscriptions: Ubuntu Server/Client Support Team
https://bugs.launchpad.net/bugs/1386157

Title:
  Memory leaks in gen_lex_hash.cc

To manage notifications about this bug go to:
https://bugs.launchpad.net/mysql-server/+bug/1386157/+subscriptions


Follow ups

References