HomePhabricator

[LSAN] Enabled only with __ANDROID_API__ >= 28

Authored by vitalybuka on Nov 4 2020, 9:42 PM.

Description

[LSAN] Enabled only with ANDROID_API >= 28

Code does not work as-is with emulated tls even if
lsan is disabled with runtime flag.

Details

Auditors
oontvoo
Committed
vitalybukaNov 4 2020, 10:18 PM
Parents
rG4455f3ce72ba: Capture the name for mlir::OpPassManager in std::string instead of StringRef…
Branches
Unknown
Tags
Unknown

Event Timeline

This commit now requires audit.Nov 4 2020, 10:19 PM

It crashes on ubsan tests on "bool DisabledInThisThread() { return disable_counter > 0; }"

Stack overflow in __emutls_get_address

Runtime flag around "disable_counter" kind of works, but it requires some investigation to be sure. I landed this to fix the bot.

if (!common_flags()->detect_leaks)
    return true;
oontvoo accepted this commit.Nov 5 2020, 6:06 AM
oontvoo added a subscriber: oontvoo.

(sorry for the late response)

All concerns with this commit have now been addressed.Nov 5 2020, 6:06 AM

Runtime flag around "disable_counter" kind of works, but it requires some investigation to be sure. I landed this to fix the bot.

if (!common_flags()->detect_leaks)
    return true;

I've tried it before. Didn't seem to work.
I think the issue is we can't have a TLS variable if you set -fno-emulated-tls AND the itself platform doesn't have ELF-TLS.

It crashes on ubsan tests on "bool DisabledInThisThread() { return disable_counter > 0; }"

Are you sure it crashes *only* in ubsan tests? This should be a problem for all leak-related tests, no?

Runtime flag around "disable_counter" kind of works, but it requires some investigation to be sure. I landed this to fix the bot.

if (!common_flags()->detect_leaks)
    return true;

I've tried it before. Didn't seem to work.
I think the issue is we can't have a TLS variable if you set -fno-emulated-tls AND the itself platform doesn't have ELF-TLS.

It crashes on ubsan tests on "bool DisabledInThisThread() { return disable_counter > 0; }"

Are you sure it crashes *only* in ubsan tests? This should be a problem for all leak-related tests, no?

No, it's not only them. I just used them for verification.