Bug #93165 | Memory leak in sync_latch_meta_init() after mysqld shutdown detected by ASan | ||
---|---|---|---|
Submitted: | 12 Nov 2018 15:11 | Modified: | 26 Nov 2018 21:02 |
Reporter: | Yura Sorokin (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.7.23, 5.7.24 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[12 Nov 2018 15:11]
Yura Sorokin
[12 Nov 2018 15:13]
Yura Sorokin
Observed in MySQL Server 5.7.23. 8.0 is most probably affected as well.
[13 Nov 2018 9:12]
MySQL Verification Team
Hello Yura, Thank you for the report and contribution. I'm seeing this issue on 5.7.23 but no longer with 5.7.24. Could you please confirm if you are seeing this on 5.7.24? In that case may I request to please provide exact cmake options used for the build? I'm joining build and test results from my environment shortly for your reference. regards, Umesh
[13 Nov 2018 9:12]
MySQL Verification Team
test results
Attachment: 93164_93165.results (application/octet-stream, text), 10.71 KiB.
[13 Nov 2018 14:59]
MySQL Verification Team
Thank you for the feedback! regards, Umesh
[26 Nov 2018 15:53]
Tor Didriksen
Posted by developer: The test explicitly injects internal fatal innodb errors, which will make innodb terminate the server (with e.g. exit(3)) There is no point in trying to do a clean shutdown in such cases.
[26 Nov 2018 21:02]
Yura Sorokin
Sorry, Tor, I disagree here. The point here is to still be able to detect memory leaks other than those you call "expected". In commit https://github.com/mysql/mysql-server/commit/e93e8db42d89154b37f63772ce68c1efda637609 you literally made 14 MTR test cases ignore ALL memory problems detected by ASan, not only those which you consider 'OK' when you terminate the process with the call to 'exit()'. In other words, new memory leaks introduced in FUTURE commits may not be detected because of those changes. Address Sanitizer is a very powerful tool and its coverage should be constantly extending rather than shrinking. Therefore, I still believe that it's better to fix these errors with proper resource cleanup (calling 'sync_latch_meta_destroy()') even in process termination error paths. However, if this fix introduces significant delay in process exit, these cleanups can only be added for ASan builds. #if defined(__SANITIZE_ADDRESS__) sync_latch_meta_destroy(); #endif