CFI build is missing Assertions.h from symbol-store

RESOLVED FIXED in Firefox 62

Status

defect
RESOLVED FIXED
Last year
8 months ago

People

(Reporter: tjr, Assigned: tjr)

Tracking

(Blocks 1 bug)

3 Branch
mozilla62
Dependency tree / graph

Firefox Tracking Flags

(firefox62 fixed)

Details

Attachments

(1 attachment)

As shown here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=499950cdf0aeedebf84a470353800e8b3b6a3e9d&selectedJob=181370190

When building with CFI testSymbolstore fails with the error:

> AssertionError: should have a FILE line for mfbt/Assertions.h

Checking a loaner indicates that it is indeed missing:

> root@e39768240a8c:~/workspace/build/src# grep Assertions.h /builds/worker/workspace/build/src/obj-firefox/dist/crashreporter-symbols/firefox/C2C150DB8C83FBE700000000000000000/firefox.sym 
> root@e39768240a8c:~/workspace/build/src# grep Assertions /builds/worker/workspace/build/src/obj-firefox/dist/crashreporter-symbols/firefox/C2C150DB8C83FBE700000000000000000/firefox.sym 
> FILE 18 hg:hg.mozilla.org/try:mfbt/Assertions.cpp:499950cdf0aeedebf84a470353800e8b3b6a3e9d

Strangely enough a pure LTO build (no CFI) did not have this error as shown here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9f459026b466e5b1db0d8573e103c82dce267bca&filter-searchStr=build%20lto
So this line is present on debug builds; but not opt builds.
So the point of this test is really just to ensure that headers that get installed in dist/include get properly mapped back to the source directory with hg info included in FILE lines. I chose Assertions.h because it seemed unlikely to break in the future, but perhaps that was a poor choice! My best guess is that the LTO build is able to optimize away all references to Assertions.h?

We can change this to some other header file that comes from dist/include that shows up in firefox.sym. The test uses firefox.sym because dumping symbols from libxul takes forever, but that does limit our options a bit.
I don't know for certain that's what's happening (this occur occur on pure-LTO builds; only LTO+CFI builds) but here are the header files included in the symfile in an opt build:

> root@50e74674d736:~/workspace/build/src# grep FILE /tmp/tmp9QJIFF/firefox/B2CD948749666CC300000000000000000/firefox.sym  | grep "\.h"
> FILE 3 hg:hg.mozilla.org/mozilla-unified:clang/include/c++/4.9.4/bits/basic_string.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 5 hg:hg.mozilla.org/mozilla-unified:clang/include/c++/4.9.4/tr1/hashtable_policy.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 6 hg:hg.mozilla.org/mozilla-unified:clang/lib/clang/7.0.0/include/cpuid.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 7 hg:hg.mozilla.org/mozilla-unified:memory/build/Mutex.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 8 hg:hg.mozilla.org/mozilla-unified:memory/build/malloc_decls.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 11 hg:hg.mozilla.org/mozilla-unified:memory/build/rb.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 12 hg:hg.mozilla.org/mozilla-unified:memory/build/replace_malloc_bridge.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 25 hg:hg.mozilla.org/mozilla-unified:mfbt/decimal/Decimal.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 28 hg:hg.mozilla.org/mozilla-unified:mfbt/double-conversion/double-conversion/bignum.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 32 hg:hg.mozilla.org/mozilla-unified:mfbt/double-conversion/double-conversion/double-conversion.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 35 hg:hg.mozilla.org/mozilla-unified:mfbt/double-conversion/double-conversion/ieee.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 37 hg:hg.mozilla.org/mozilla-unified:mfbt/double-conversion/double-conversion/utils.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 48 hg:hg.mozilla.org/mozilla-unified:mfbt/EndianUtils.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 49 hg:hg.mozilla.org/mozilla-unified:mfbt/Pair.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 50 hg:hg.mozilla.org/mozilla-unified:mozglue/misc/Printf.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 51 hg:hg.mozilla.org/mozilla-unified:mfbt/Sprintf.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 52 hg:hg.mozilla.org/mozilla-unified:mozglue/misc/TimeStamp.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 53 hg:hg.mozilla.org/mozilla-unified:mfbt/UniquePtr.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 54 hg:hg.mozilla.org/mozilla-unified:mfbt/Vector.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 55 hg:hg.mozilla.org/mozilla-unified:xpcom/build/BinaryPath.h:d029c1546e8f63f190c03b60e33037a092ec6ca3
> FILE 60 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
> FILE 61 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h
> FILE 62 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_bitvector.h
> FILE 63 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_bvgraph.h
> FILE 64 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_common.h
> FILE 66 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector.h
> FILE 69 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
> FILE 74 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_mutex.h
> FILE 80 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stackdepotbase.h
> FILE 93 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h
> FILE 95 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/ubsan/ubsan_diag.h
> FILE 100 /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/ubsan/ubsan_value.h
Got the same problem on lto builds when landing bug 1462498.
Blocks: 1462498
Comment on attachment 8983474 [details]
Bug 1466242 Look for Sprintf.h instead of Assertions.h in the symbolstore test

https://reviewboard.mozilla.org/r/249338/#review256430
Attachment #8983474 - Flags: review+
Comment on attachment 8983474 [details]
Bug 1466242 Look for Sprintf.h instead of Assertions.h in the symbolstore test

https://reviewboard.mozilla.org/r/249338/#review256432

::: toolkit/crashreporter/tools/unit-symbolstore.py:538
(Diff revision 1)
>                  filename = line.split(None, 2)[2]
>                  self.assertEqual('hg:', filename[:3])
>          # Check that nsBrowserApp.cpp is listed as a FILE line, and that
>          # it was properly mapped to the source repo.
>          check_hg_path(file_lines, 'nsBrowserApp.cpp')
>          # Also check Assertions.h to verify that files from dist/include

The comment needs an update. I'm going to land this on inbound with the comment updated.
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/badcfe94e6a7
Look for Sprintf.h instead of Assertions.h in the symbolstore test r=glandium
https://hg.mozilla.org/mozilla-central/rev/badcfe94e6a7
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.