Page MenuHomePhabricator

meson: Changed meson build to support address sanitizer build
ClosedPublic

Authored by smohanty on Jan 20 2020, 6:06 PM.

Details

Summary

As we run some intermediate binary like edje_cc during efl build , and due to
those binary has some memory leaks the address sanitizer build of efl fails.
This Patch runs those binary with 'ASAN_OPTIONS=detect_leak=false' to disable the
memory leak check for those binaries.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
smohanty created this revision.Jan 20 2020, 6:06 PM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

smohanty requested review of this revision.Jan 20 2020, 6:06 PM
bu5hm4n added a subscriber: stefan_schmidt.

I think @stefan_schmidt should check this out. He does all the things arround asan.

I think it make sense to have a working build when the address sanitizer option is enabled. Thanks for working on this.
The approach for running asan on the CI infra is to use a suppression file to ignore the known leaks:
https://git.enlightenment.org/core/efl.git/tree/.ci/asan-ignore-leaks.supp
LSAN_OPTIONS=suppressions=/src/.ci/asan-ignore-leaks.supp
This would make sure we will notice new leaks that we might want to check during development.

Not really committed to either of the two approaches. Would you be interested in switching thsi patch to using the ignore file or would you prefer the full leak ignore approach?

zmike added a subscriber: zmike.Mar 18 2020, 7:11 AM

What's going on here?

From my side I am waiting for feedback from @smohanty

As written before I am fine with the approach as is. If we go the route of disable all leak checks or only suppress the known ones I have no strong opinion.

From my side I am waiting for feedback from @smohanty

As written before I am fine with the approach as is. If we go the route of disable all leak checks or only suppress the known ones I have no strong opinion.

Sorry for the late reply.

If the suppression file can be checked in to the Meson build system and as a user I have to only configure with b_sanitize then am OK with that approch.

@stefan_schmidt ,

If you can add a patch which includes the suppression file and pass it to edje_cc during build time when b_sanitize is ON that will be great.

If its too much work then as edje_cc is not that important (in memory leak perspective) we can just ignore the leak we can go ahead with this patch.

We have some sort of suppression for CI purpose already, but I think we can just go with disable leak for the build stage. It would be to much fiddling.

I just tested your patch and it still applies and works fine. I am working on extending this to ninja test now as well. Should have something soon.

This revision is now accepted and ready to land.May 20 2020, 3:31 AM
This revision was automatically updated to reflect the committed changes.