Scrub out junk from Rust signatures in LSan white list

RESOLVED FIXED in Firefox 65

Status

enhancement
P3
normal
RESOLVED FIXED
8 months ago
6 months ago

People

(Reporter: mccr8, Assigned: jgraham)

Tracking

Version 3
mozilla65
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox65 fixed)

Details

Attachments

(1 attachment)

If my patch in bug 1480799 works, the WPT LSan whitelists should have their Rust signatures all scrubbed of the weird junk that seems to change depending on the build or compiler, and the importing mechanism should be changed to also scrub it, so we don't add more. I don't know if those need to be separate bugs or not.

A better fix would be to adjust the lsan-symbolizer to properly demangle Rust symbols, though that would also require regenerating these frames, in a different way. I'm not sure if that is easy or not.

Here's an excerpt of lsan-allowed looks like [1] with some formatting:
alloc_system::platform::_$LT$impl$u20$core..alloc..GlobalAlloc$u20$for$u20$alloc_system..System$GT$::alloc::h5a1f0db41e296502,
alloc_system::platform::_$LT$impl$u20$core..alloc..GlobalAlloc$u20$for$u20$alloc_system..System$GT$::alloc::h82bf91dcf8d89ced,
alloc_system::platform::_$LT$impl$u20$core..alloc..GlobalAlloc$u20$for$u20$alloc_system..System$GT$::alloc::hd3c140e687e2a935,
alloc_system::platform::_$LT$impl$u20$core..alloc..GlobalAlloc$u20$for$u20$alloc_system..System$GT$::realloc::h3ab64a4bcafe2c39,
alloc_system::platform::_$LT$impl$u20$core..alloc..GlobalAlloc$u20$for$u20$alloc_system..System$GT$::realloc::h5c6d61654badfe59,
alloc_system::platform::_$LT$impl$u20$core..alloc..GlobalAlloc$u20$for$u20$alloc_system..System$GT$::realloc::hfdaa883bde7dcfa7,

The idea is the various "h5a1f0db41e296502" stuff should be removed, and not introduced. Looking at the change log for this file, it seems like whatever changes in the compiler periodically, which introduces new leaks at import time, and then the new variant is added, which keeps us from leaking until whatever other compiler state happens.

[1] testing/web-platform/meta/webauthn/__dir__.ini
James, do you have time to look at this in the next week? If not, I can try my hand at it.
Flags: needinfo?(james)
Priority: -- → P3
Flags: needinfo?(james)
Rust signatures aren't properly demangled, and contain some trailing
data that seems to depend on the compiler version. This defeats the
attempt to allow LSAN errors when importing tests, and we end up
adding multiple variants of the same symbol to the allow list.

To avoid this, simply preprocess the symbols not to contain the
trailing junk when reading LSAN output, whilst we await better
demangling.
Blocks: 1480799
Thanks for working on this.
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6beca6ad237e
Scrub out junk from rust signatures when processing LSAN data, r=mccr8
https://hg.mozilla.org/integration/mozilla-inbound/rev/4700d8714486
Fixup existing LSAN allowed rules to match new behaviour, a=testonly
https://hg.mozilla.org/mozilla-central/rev/6beca6ad237e
https://hg.mozilla.org/mozilla-central/rev/4700d8714486
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Blocks: 1519676
No longer blocks: 1519676
You need to log in before you can comment on or make changes to this bug.