Skip to content

Enable GCC and Clang address sanitizer - #504

Merged
ardovm merged 4 commits into
trunkfrom
asan
Nov 8, 2026
Merged

ardovm merged 4 commits into
trunkfrom
asan

Conversation

@ardovm

@ardovm ardovm commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

The address sanitizer can be a useful tool for debugging.

Many of the tools built for the purpose of building AOO are leaking memory by design (they can afford that: they have very short execution time and are not designed to be distributed) so the leak detection is disabled during the AOO build.

This PR was tested under Linux only. I had to disable unit tests. Some modules do not seem to build with the sanitizer enabled... but this could be a good start for further debugging.

Added configure parameter --enable-sanitizer
Not supported under Windows
Many tools deliberately do not care about memory leaks, due to their
intended usage.
@ardovm
ardovm merged commit 17d397d into trunk Nov 8, 2026
1 check passed
@ardovm
ardovm deleted the asan branch November 8, 2026 06:53
@DamjanJovanovic

Copy link
Copy Markdown
Contributor

I had to disable unit tests. Some modules do not seem to build with the sanitizer enabled... but this could be a good start for further debugging.

I tried this before, and in a 2017-11-26 email entitled "How to evaluate OSS-Fuzz issues", I said that:

"The whole of AOO can't be built with ASAN for many reasons. Some of the linker options we use conflict with ASAN. Even when that's fixed I got other errors. Worst of all, some internal build tools (can't remember which) rely on buffer overflows to work properly 🙈, and ASAN causes them to crash and break the build instead..."

@ardovm

ardovm commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

My attempt was more successful than yours, but it's not my merit. ;-)
For example, c56f8ff and 8ebeb3b were not there when you tried. I just discovered them while trying to enable the sanitizer for AOO41X.
I could successfuly build trunk on my Linux system with the sanitizer enabled just adding 776d9c2.

@ardovm

ardovm commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, I forgot an important note: the build with the sanitizer fails on testools module, bridgetest test.
I had to disable it for the build to succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants