Facilitate running Evolution under Clang/ASAN
Compling code under Address Sanitizer (ASAN) instruments the calls to malloc/realloc/free. Before an instrumented code is loaded for execution, the code that handles the instrumented malloc/realloc/free calls must be loaded.
For binaries, when linked by clang -fsanitze=address
the compiler inserts the code that handles the instrumented malloc/realloc/free calls in the binary. Then this binary can load also DSOs containing instrumented code.
Linking DSOs with clang -fsanitize=address
does nothing. To load such an instrumented library either the executable must be linked with -fsanitize=address, or the executable must be started using LD_PRELOAD=libclang_rt.asan-x86_64.so. There is no third option, e.g. linking the DSOs in a special way: per https://github.com/google/sanitizers/issues/1086 and the silence linking DSOs with -static-asan or -shared-asan has no impact, apart from resolving symbols only at link time.
However the special handling code must be loaded exactly once. Thus using LD_PRELOAD to start an executable that loads an instrumented library, is mutually exclusive to loading an instrumented library by a binary that is linked with -fsanitize=address.
I compile and link Evolution and EDS using -fsanitize=address. Starting evolution prints afterwards
Error loading module '/usr/local/lib/evolution/web-extensions/libewebextension.so': /usr/local/lib/evolution-data-server/libedbus-private.so: undefined symbol: __asan_option_detect_stack_use_after_return
Error loading module '/usr/local/lib/evolution/web-extensions/module-itip-formatter-webextension.so': /usr/local/lib/evolution-data-server/libedbus-private.so: undefined symbol: __asan_option_detect_stack_use_after_return
so I cannot write emails, when Evolution is compiled under ASAN. I do not want to compile Webkit under ASAN, as this would be too much and could then mess other programs.
- Provide an option for evolution to set LD_PRELOAD before calling the executable, that loads libedbus-private.so or module-itip-formatter-webextension.so.