-
Notifications
You must be signed in to change notification settings - Fork 1
Build with ASAN and check leaks #24
Comments
There is an issue about this (google/sanitizers#796) and as we're using GCC the correct linker flags are As expected we leak memory:
|
With z3 built with address sanitize we get the following result:
(I omitted the few hundred lines of traces). |
The memory leaks come from 2 sources
The non-freed memory has been fixed. To solve the memory issues caused by contexts and configs these types have to be implemented as controlled types. As controlled types seem to be difficult to use as constants if defined in the same package (since the body of Finalize needs to be seen) we decided to not provide a default context anymore. |
I'm relatively confident that we now have a working implementation. There are no further memory leaks in z3. However there are still some calls to |
Creating a separate test without AUnit is probably not worth the effort right now. We could suppress the leak instead. |
The following 3 leaks happen even with empty tests:
The 4th leak seems to happen in
I looked into supressing the Aunit leaks. The problem is we can only suppress leaks by symbol, source or binary name. In this exact case the only information we have is that it happens in libgnat.so in __gnat_malloc. If we suppress this we will miss all memory leaks from Ada. The best method to distinguish between Aunit leaks and our leaks I have is that Aunit leaks all seem to be indirect leaks while ours are direct leaks. However Asan doesn't provide any useful tool to suppress only indirect leaks (see google/sanitizers#1250). Turning off all leaks that include |
Result of a separate discussion: Let's try to use AUnit as a submodule and build it from sources with asan and debug symbols enabled. If all of the remaining leaks can be traced back to AUnit either suppress or fix them. |
Build z3 and our test suite with ASAN and enable resource leak checks:
The text was updated successfully, but these errors were encountered: