hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.07k stars 172 forks source link

Fix issues found by address sanitization #2070

Closed theGreatWhiteShark closed 2 days ago

theGreatWhiteShark commented 4 days ago

Using the option -fsanitize=address for gcc I was able to spot a number of memory issues.

However, the search for memory leaks is just too detailed. I got a lot of errors we can do nothing about, like the destructor of ServerThread in liblo, the loading of QXmlSchema in Qt5, things in libasound2 (ALSA), PortAudio, JACK.... Using preprocessor macros to blacklist functions calling the affected routines does not work either (the flag is probably not propagated and just sticks to the symbol. But I have no idea about compilers and probably writing nonsense). That's why using an address sanitizer within our build pipeline is off the table.