Open Bug 1507350 Opened 2 years ago Updated 2 years ago
Rust symbols in LSan stacks are a little garbled
Maybe there's a bug on file for this already, but the symbolicator used by LSan (and presumably LSan in general) reports frames for Rust that don't seem to be fully demangled. I don't look at a lot of Rust stack frames, so maybe this is normal? But they look like this: #1 0x7fd04df39c4b in alloc_system::platform::_$LT$impl$u20$core..alloc..GlobalAlloc$u20$for$u20$alloc_system..System$GT$::alloc::h82bf91dcf8d89ced /builds/worker/workspace/build/src/liballoc_system/lib.rs:140:16 #2 0x7fd04df39c4b in __rdl_alloc /rustc/da5f414c2c0bfe5198934493f04c676e2b23ff2e/src/libstd/alloc.rs:157 #3 0x7fd04df39c4b in alloc::alloc::alloc::h20a7d0505176962b /builds/worker/workspace/build/src/liballoc/alloc.rs:78 #4 0x7fd04df39c4b in _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Alloc$GT$::alloc::h40b7a00e8d496106 /builds/worker/workspace/build/src/liballoc/alloc.rs:154 The h82bf91dcf8d89ced part of it seems to change, which causes problems for the white list we use based on stack frames. The symbolizer for ASan builds is set by the env var LLVM_SYMBOLIZER and uses llvm-symbolizer, so I'm not sure if anything can be done about this. From this log: https://treeherder.mozilla.org/logviewer.html#?job_id=211748102&repo=autoland&lineNumber=32981
Because the WPT tests use whitelists that were automatically generated from the existing leaks, including these mangled stack frames, the whitelists would have to be recreated. Presumably, whatever automatic process that was used to generate the initial whitelist could be used again.
llvm-symbolizer doesn't know how to demangle rust symbols fully.
Yeah, I figured that might be the case. Is there any hope of that changing in the near term? Or would we have to do something like write our own drop in replacement for llvm-symbolizer that does work on Rust symbols?
The latter would probably be a good idea, as it could be used for other things than sanitizers (e.g. it could be used to replace the fix*stack* scripts we use for test harnesses), although I don't know if the "interface" between sanitizers and llvm-symbolizer is stable.
You need to log in before you can comment on or make changes to this bug.