Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 584262cd authored by Yi Kong's avatar Yi Kong
Browse files

Workaround ASAN false positive

There is a known ASAN false positive case. If a part of the application
is built with asan and another part is not instrumented, and both parts
use e.g. instrumented std::vector, asan may report non-existent
container overflow. This happens because instrumented and
non-instrumented bits of std::vector, inlined and not, are mixed during
linking, so you end up with incompletely instrumented std::vector.

https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow

Workaround the issue by statically linking in libbase, thus its code also
becomes instrumented.

Test: Run resolv_integration_test
Bug: 139838864
Bug: 131328001
Change-Id: I9fe0fcb57016273e505810345162ce6c55565381
Exempt-From-Owner-Approval: Fix build breakage, no functionality change.
parent 3e829060
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -164,15 +164,16 @@ cc_test {
    ],
    shared_libs: [
        "libbpf_android",
        "libbase",
        "libbinder",
        "libcrypto",
        "liblog",
        "libnetd_client",
        "libssl",
        "libutils",
    ],
    static_libs: [
        "dnsresolver_aidl_interface-cpp",
        "libbase",
        "libgmock",
        "libnetd_test_dnsresponder",
        "libnetd_test_metrics_listener",