Bug #89544 LeakSanitizer errors on failed server startup due to DD engine init fail
Submitted: 6 Feb 2018 4:16 Modified: 9 Feb 2018 6:21
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Data Dictionary Severity:S3 (Non-critical)
Version:8.0.4 OS:Any
Assigned to: CPU Architecture:Any

[6 Feb 2018 4:16] Laurynas Biveinis
Where AddressSanitizer includes LeakSanitizer:

innodb.innodb_bug70867                   [ fail ]
        Test ended at 2018-02-06 06:12:54

CURRENT_TEST: innodb.innodb_bug70867
mysqltest: At line 26: command "$MYSQLD_CMD --innodb_data_home_dir=$MYSQL_DATA_DIR/tmpdata $args" failed with wrong error: 42
safe_process[1887]: Child process: 1888, exit: 1

If the testcase is patched not to remove var/log/my_restart.err, then this log will show

2018-02-06T04:12:50.709483Z 1 [ERROR] [MY-011066] InnoDB: Operating system error number 13 in a file operation.
2018-02-06T04:12:50.709546Z 1 [ERROR] [MY-011066] InnoDB: The error means mysqld does not have the access rights to the directory.
2018-02-06T04:12:50.709579Z 1 [ERROR] [MY-011066] InnoDB: os_file_get_status() failed on '/home/laurynas/obj-mysql-8.0.4-san-debug/mysql-test/var/mysqld.1/data//tmpdata/ibdata1'. Can't determine file permissions
2018-02-06T04:12:50.709671Z 1 [ERROR] [MY-010334] Failed to initialize DD Storage Engine
2018-02-06T04:12:50.710098Z 0 [ERROR] [MY-010020] Data Dictionary initialization failed.
2018-02-06T04:12:50.710136Z 0 [ERROR] [MY-010119] Aborting
2018-02-06T04:12:50.712238Z 0 [System] [MY-010910] /home/laurynas/obj-mysql-8.0.4-san-debug/runtime_output_directory/mysqld-debug: Shutdown complete.

==1893==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 1056 byte(s) in 1 object(s) allocated from:
    #0 0x7f2a7159c7d8 in operator new(unsigned long, std::nothrow_t const&) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe07d8)
    #1 0x55cc568c550f in dd::Object_table::create_object_table() /home/laurynas/mysql-8.0.4/sql/dd/impl/types/object_table_impl.cc:81
    #2 0x55cc5e9f29c4 in innobase_ddse_dict_init /home/laurynas/mysql-8.0.4/storage/innobase/handler/ha_innodb.cc:12354
    #3 0x55cc58a4d042 in dd::bootstrap::DDSE_dict_init(THD*, dict_init_mode_t, unsigned int) /home/laurynas/mysql-8.0.4/sql/dd/impl/bootstrapper.cc:2245
    #4 0x55cc56c145c2 in dd::upgrade_57::do_pre_checks_and_initialize_dd(THD*) /home/laurynas/mysql-8.0.4/sql/dd/upgrade/upgrade.cc:1004
    #5 0x55cc57352128 in handle_bootstrap /home/laurynas/mysql-8.0.4/sql/bootstrap.cc:343
    #6 0x55cc60250a28 in pfs_spawn_thread /home/laurynas/mysql-8.0.4/storage/perfschema/pfs.cc:2994
    #7 0x7f2a712a47fb in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x77fb)

... etc ...

How to repeat:
System where AddressSanitizer includes LeakSanitizer, -DWITH_DEBUG=ON -DWITH_ASAN=ON,
./mtr --debug-server innodb_bug70867
[6 Feb 2018 4:26] Laurynas Biveinis
Likewise on innodb.temporary_table
[6 Feb 2018 4:30] Laurynas Biveinis
Likewise on innodb.innodb-wl6445-2
[9 Feb 2018 6:21] MySQL Verification Team
Hello Laurynas,

Thank you for the report and feedback.
Confirmed that tests are failing, innodb_bug70867 with "mysqltest: At line 26: command "$MYSQLD_CMD --innodb_data_home_dir=$MYSQL_DATA_DIR/tmpdata $args" failed with wrong error: 23" etc. Nothing much logged to the error log.

[9 Feb 2018 6:22] MySQL Verification Team
test results

Attachment: 89544.results (application/octet-stream, text), 276.62 KiB.