Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-DWITH_ASAN=ON results in broken server if system AddressSanitizer includes LeakSanitizer #567

Closed
laurynas-biveinis opened this issue Mar 14, 2017 · 1 comment

Comments

@laurynas-biveinis
Copy link
Contributor

If LeakSanitizer is included in system AddressSanitizer (e.g. Ubuntu 16.10), the built server is not able to bootstrap:

cmake ... -DWITH_ASAN=ON ...
...
$ ./mtr --debug-server fast_prefix_index_fetch_innodb
...
Installing system database...
mysql-test-run: *** ERROR: Error executing mysqld --bootstrap

The bootstrap log contains

2017-03-14 13:52:49 14546 [Note] InnoDB: Shutdown completed; log sequence number 1632921

=================================================================
==14546==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 56 byte(s) in 1 object(s) allocated from:
#0 0x7f6ee7856eb0 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc6eb0)
#1 0x55ea4ed7449e in ut_malloc_low(unsigned long, unsigned long) /home/laurynas/mysql-server/storage/innobase/ut/ut0me
m.cc:104
#2 0x55ea4ed77101 in rbt_create(unsigned long, int ()(void const, void const*)) /home/laurynas/mysql-server/storage/
innobase/ut/ut0rbt.cc:802
#3 0x55ea4ee401c0 in buf_flush_init_flush_rbt() /home/laurynas/mysql-server/storage/innobase/buf/buf0flu.cc:257
#4 0x55ea4eb4e474 in recv_sys_init(unsigned long) /home/laurynas/mysql-server/storage/innobase/log/log0recv.cc:396
#5 0x55ea4ecfe4e0 in innobase_start_or_create_for_mysql() /home/laurynas/mysql-server/storage/innobase/srv/srv0start.c
c:2190
#6 0x55ea4ea7e09c in innobase_init /home/laurynas/mysql-server/storage/innobase/handler/ha_innodb.cc:4204
#7 0x55ea4dedc826 in ha_initialize_handlerton(st_plugin_int*) /home/laurynas/mysql-server/sql/handler.cc:675
#8 0x55ea4e38d5c2 in plugin_initialize /home/laurynas/mysql-server/sql/sql_plugin.cc:1163
#9 0x55ea4e390899 in plugin_init(int*, char**, int) /home/laurynas/mysql-server/sql/sql_plugin.cc:1465
#10 0x55ea4dea8f96 in init_server_components /home/laurynas/mysql-server/sql/mysqld.cc:5911
#11 0x55ea4deaf124 in mysqld_main(int, char**) /home/laurynas/mysql-server/sql/mysqld.cc:7251
#12 0x55ea4de8d428 in main /home/laurynas/mysql-server/sql/main.cc:25
#13 0x7f6ee5a303f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f6ee7856eb0 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc6eb0)
#1 0x55ea4ed7449e in ut_malloc_low(unsigned long, unsigned long) /home/laurynas/mysql-server/storage/innobase/ut/ut0mem.cc:104
#2 0x55ea4ed77143 in rbt_create(unsigned long, int ()(void const, void const*)) /home/laurynas/mysql-server/storage/innobase/ut/ut0rbt.cc:808
#3 0x55ea4ee401c0 in buf_flush_init_flush_rbt() /home/laurynas/mysql-server/storage/innobase/buf/buf0flu.cc:257
#4 0x55ea4eb4e474 in recv_sys_init(unsigned long) /home/laurynas/mysql-server/storage/innobase/log/log0recv.cc:396
#5 0x55ea4ecfe4e0 in innobase_start_or_create_for_mysql() /home/laurynas/mysql-server/storage/innobase/srv/srv0start.cc:2190
#6 0x55ea4ea7e09c in innobase_init /home/laurynas/mysql-server/storage/innobase/handler/ha_innodb.cc:4204
#7 0x55ea4dedc826 in ha_initialize_handlerton(st_plugin_int*) /home/laurynas/mysql-server/sql/handler.cc:675
#8 0x55ea4e38d5c2 in plugin_initialize /home/laurynas/mysql-server/sql/sql_plugin.cc:1163
#9 0x55ea4e390899 in plugin_init(int*, char**, int) /home/laurynas/mysql-server/sql/sql_plugin.cc:1465
#10 0x55ea4dea8f96 in init_server_components /home/laurynas/mysql-server/sql/mysqld.cc:5911
#11 0x55ea4deaf124 in mysqld_main(int, char**) /home/laurynas/mysql-server/sql/mysqld.cc:7251
#12 0x55ea4de8d428 in main /home/laurynas/mysql-server/sql/main.cc:25
#13 0x7f6ee5a303f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f6ee7856eb0 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc6eb0)
#1 0x55ea4ed7449e in ut_malloc_low(unsigned long, unsigned long) /home/laurynas/mysql-server/storage/innobase/ut/ut0mem.cc:104
#2 0x55ea4ed771f3 in rbt_create(unsigned long, int ()(void const, void const*)) /home/laurynas/mysql-server/storage/innobase/ut/ut0rbt.cc:816
#3 0x55ea4ee401c0 in buf_flush_init_flush_rbt() /home/laurynas/mysql-server/storage/innobase/buf/buf0flu.cc:257
#4 0x55ea4eb4e474 in recv_sys_init(unsigned long) /home/laurynas/mysql-server/storage/innobase/log/log0recv.cc:396
#5 0x55ea4ecfe4e0 in innobase_start_or_create_for_mysql() /home/laurynas/mysql-server/storage/innobase/srv/srv0start.cc:2190
#6 0x55ea4ea7e09c in innobase_init /home/laurynas/mysql-server/storage/innobase/handler/ha_innodb.cc:4204
#7 0x55ea4dedc826 in ha_initialize_handlerton(st_plugin_int*) /home/laurynas/mysql-server/sql/handler.cc:675
#8 0x55ea4e38d5c2 in plugin_initialize /home/laurynas/mysql-server/sql/sql_plugin.cc:1163
#9 0x55ea4e390899 in plugin_init(int*, char**, int) /home/laurynas/mysql-server/sql/sql_plugin.cc:1465
#10 0x55ea4dea8f96 in init_server_components /home/laurynas/mysql-server/sql/mysqld.cc:5911
#11 0x55ea4deaf124 in mysqld_main(int, char**) /home/laurynas/mysql-server/sql/mysqld.cc:7251
#12 0x55ea4de8d428 in main /home/laurynas/mysql-server/sql/main.cc:25
#13 0x7f6ee5a303f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)

SUMMARY: AddressSanitizer: 136 byte(s) leaked in 3 allocation(s).

This is same as https://bugs.mysql.com/bug.php?id=81674. A possible fix is backported from MySQL 5.7 at percona/percona-server#677.

A workaround is ASAN_OPTIONS="detect_leaks=0" in environment

@laurynas-biveinis
Copy link
Contributor Author

You probably have fixed this by fefc12e

@lth lth closed this as completed Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants