Bug #96471 Memory leak after 'group_replication.gr_majority_loss_restart'
Submitted: 8 Aug 2019 12:56 Modified: 3 Sep 2019 11:05
Reporter: Yura Sorokin (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:5.7.27 OS:Any
Assigned to: CPU Architecture:Any

[8 Aug 2019 12:56] Yura Sorokin
Description:
The following Address Sanitizer log is generated after running 'group_replication.gr_majority_loss_restart' MTR test case

[ 50%] group_replication.gr_majority_loss_restart [ pass ]  96916
worker[1] Sanitizer report from /home/yura/addon/local/percona-build-5.7-asan_gcc8/mysql-test/var/log/mysqld.1.err after tests:
 group_replication.gr_majority_loss_restart
--------------------------------------------------------------------------
==34406==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 10 byte(s) in 1 object(s) allocated from:
    #0 0x7f726fb7a108 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee108)
    #1 0x7f7257b873bc  (<unknown module>)
    #2 0x7f7257b8caa2  (<unknown module>)
    #3 0x7f7257b95540  (<unknown module>)
    #4 0x7f7257b6b6fd  (<unknown module>)
    #5 0x7f7257b6e77f  (<unknown module>)
    #6 0x7f7257b76357  (<unknown module>)
    #7 0x7f7257b7c06a  (<unknown module>)
    #8 0x7f7257b881e4  (<unknown module>)
    #9 0x7f7257ba58b4  (<unknown module>)
    #10 0x7f7257b6b24c  (<unknown module>)
    #11 0x7f7257c49b0e  (<unknown module>)
    #12 0x7f7257bdbc06  (<unknown module>)
    #13 0x7f726f8746da in start_thread /build/glibc-OTsEL5/glibc-2.27/nptl/pthread_create.c:463

Direct leak of 10 byte(s) in 1 object(s) allocated from:
    #0 0x7f726fb7a108 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xee108)
    #1 0x7f7257b873bc  (<unknown module>)
    #2 0x7f7257b8caa2  (<unknown module>)
    #3 0x7f7257b70f72  (<unknown module>)
    #4 0x7f7257b788fa  (<unknown module>)
    #5 0x7f7257b8095a  (<unknown module>)
    #6 0x7f7257ba58b4  (<unknown module>)
    #7 0x7f7257b6b24c  (<unknown module>)
    #8 0x7f7257c49b0e  (<unknown module>)
    #9 0x7f7257bdbc06  (<unknown module>)
    #10 0x7f726f8746da in start_thread /build/glibc-OTsEL5/glibc-2.27/nptl/pthread_create.c:463

SUMMARY: AddressSanitizer: 20 byte(s) leaked in 2 allocation(s).
safe_process[34405]: Child process: 34406, exit: 42

[100%] sanitize_report                          [ fail ]
        Test ended at 2019-08-08 12:23:09

How to repeat:
build MySQL Server with gcc-8 and with Address Sanitizer enabled (-DWITH_ASAN=ON)
CC=gcc-8 CXX=g++-8 cmake -DWITH_ASAN=ON ...

run
./mysql-test/mtr --big-test --debug-server --sanitize group_replication.gr_majority_loss_restart
[9 Aug 2019 7:51] MySQL Verification Team
Hello Yura Sorokin,

Thank you for the report and feedback.

Thanks,
Umesh
[9 Aug 2019 7:52] MySQL Verification Team
Test results - 5.7.27

Attachment: 96471_5.7.27.results (application/octet-stream, text), 241.15 KiB.

[3 Sep 2019 11:05] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL 8.0.19 and 5.7.29:

A memory leak could occur when a failed replication group member tried to rejoin a minority group and was disallowed from doing so.