tag:blogger.com,1999:blog-3080615211468083537.post2010791339813450285..comments2023-09-27T11:36:08.392+03:00Comments on Blog of (former?) MySQL Entomologist: Fun with Bugs #63 - On Bugs Detected by ASanValerii Kravchukhttp://www.blogger.com/profile/13158916419325454260noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-3080615211468083537.post-40070971597083232442018-03-24T20:04:40.121+02:002018-03-24T20:04:40.121+02:00The modern compile-time instrumentation of GCC and...The modern compile-time instrumentation of GCC and clang should really belong to every C and C++ programmer’s toolchest: https://www.youtube.com/watch?v=lkgszkPnV8g<br /><br />There has been some related work in MariaDB as well. Memory poisoning was added to MariaDB 5.5 some time ago, and did already catch some minor bugs or implementation-defined behaviour. The code is present in the 10.0.34, 10.1.31, 10.2.13, and 10.3.5 releases. MariaDB also includes many contributed fixes for race conditions reported by ThreadSanitizer.<br /><br />In MariaDB 10.2, I fixed many bugs in InnoDB startup and shutdown. I am aware of only one InnoDB memory leak in MariaDB 10.2: https://jira.mariadb.org/browse/MDEV-13818 (affecting MySQL 5.7 as well).<br /><br />In MySQL 8.0, many InnoDB tests continue to leak memory; these leaks are only being ignored: https://github.com/mysql/mysql-server/commit/431607d1360cebe6c337ff7357f8e797ae23deb8<br /><br />I think that every developer should compile code with the AddressSanitizer enabled and run tests while the environment variable ASAN_OPTIONS=abort_on_error=1 is set. It would also be useful to disable safemalloc and fix all leaks that are currently hidden by safemalloc.<br /><br />Also UBSAN is very useful. Last year I fixed some InnoDB bugs with it. Some work would be needed in MariaDB to avoid false warnings. For example, uint4korr and friends are generating warnings for unaligned access even though it is fine on x86 and AMD64; maybe with UBSAN we should use the generic macros.Marko Mäkelähttps://www.blogger.com/profile/01918141282242941322noreply@blogger.com