New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 908937 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Dec 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Blocked on:
issue 904337



Sign in to add a comment

llvm: Crash when building base/trace_event/trace_event_impl.cc with coverage intrumentation

Project Member Reported by st...@chromium.org, Nov 27

Issue description

Culprit: https://chromium-review.googlesource.com/c/chromium/src/+/1346305

First failed build: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/linux-code-coverage/1067

----------------------GN config--------------------
is_clang = true
is_component_build = false
is_debug = false
strip_absolute_paths_from_debug_symbols = true
symbol_level = 0
use_clang_coverage = true
use_goma = true
goma_dir = "/b/s/w/ir/cache/goma/client"


-------------------Error log--------------

[396/49871] CXX obj/base/base/trace_event_impl.o
FAILED: obj/base/base/trace_event_impl.o
/b/s/w/ir/cache/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/base/base/trace_event_impl.o.d -DUSE_SYMBOLIZE -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DCLANG_COVERAGE -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"346388-5\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=344254 -DCR_LIBCXXABI_REVISION=344215 -D_LIBCPP_ENABLE_NODISCARD -DCR_SYSROOT_HASH=e7c53f04bd88d29d075bfd1f62b073aeb69cbe09 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -I../.. -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -fmerge-all-constants -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -no-canonical-prefixes -fcomplete-member-pointers -m64 -march=x86-64 -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-null-pointer-arithmetic -Wno-ignored-pragma-optimize -fno-omit-frame-pointer -g0 -fprofile-instr-generate -fcoverage-mapping -mllvm -limited-coverage-experimental=true -fno-use-cxa-atexit -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang enforce-in-thirdparty-webkit -Xclang -plugin-arg-find-bad-constructs -Xclang check-enum-max-value -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-char-subscripts -Wglobal-constructors -Wexit-time-destructors -Wshadow -isystem../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wexit-time-destructors -O2 -fno-ident -fdata-sections -ffunction-sections -std=c++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_amd64-sysroot -fvisibility-inlines-hidden -c ../../base/trace_event/trace_event_impl.cc -o obj/base/base/trace_event_impl.o
clang++: /b/swarming/w/ir/kitchen-workdir/src/third_party/llvm/tools/clang/lib/CodeGen/CoverageMappingGen.cpp:789: void (anonymous namespace)::CounterCoverageMappingBuilder::fillGapAreaWithCount(clang::SourceLocation, clang::SourceLocation, llvm::coverage::Counter): Assertion `SpellingRegion(SM, StartLoc, EndLoc).isInSourceOrder()' failed.
Stack dump:
0.	Program arguments: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name trace_event_impl.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -fmerge-all-constants -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -ffunction-sections -fdata-sections -fprofile-instrument=clang -fcoverage-mapping -coverage-notes-file /b/s/w/ir/cache/builder/src/out/Release/obj/base/base/trace_event_impl.gcno -nostdinc++ -resource-dir ../../third_party/llvm-build/Release+Asserts/lib/clang/8.0.0 -dependency-file obj/base/base/trace_event_impl.o.d -MT obj/base/base/trace_event_impl.o -isystem ../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem ../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem ../../buildtools/third_party/libc++/trunk/include -isystem ../../buildtools/third_party/libc++abi/trunk/include -D USE_SYMBOLIZE -D V8_DEPRECATION_WARNINGS -D USE_UDEV -D USE_AURA=1 -D USE_GLIB=1 -D USE_NSS_CERTS=1 -D USE_X11=1 -D CLANG_COVERAGE -D FULL_SAFE_BROWSING -D SAFE_BROWSING_CSD -D SAFE_BROWSING_DB_LOCAL -D CHROMIUM_BUILD -D FIELDTRIAL_TESTING_ENABLED -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D _LARGEFILE64_SOURCE -D _GNU_SOURCE -D CR_CLANG_REVISION="346388-5" -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D CR_LIBCXX_REVISION=344254 -D CR_LIBCXXABI_REVISION=344215 -D _LIBCPP_ENABLE_NODISCARD -D CR_SYSROOT_HASH=e7c53f04bd88d29d075bfd1f62b073aeb69cbe09 -D NDEBUG -D NVALGRIND -D DYNAMIC_ANNOTATIONS_ENABLED=0 -D BASE_IMPLEMENTATION -D GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -D GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -I ../.. -I gen -D __DATE__= -D __TIME__= -D __TIMESTAMP__= -isysroot ../../build/linux/debian_sid_amd64-sysroot -internal-isystem ../../build/linux/debian_sid_amd64-sysroot/usr/local/include -internal-isystem ../../third_party/llvm-build/Release+Asserts/lib/clang/8.0.0/include -internal-externc-isystem ../../build/linux/debian_sid_amd64-sysroot/usr/include/x86_64-linux-gnu -internal-externc-isystem ../../build/linux/debian_sid_amd64-sysroot/include -internal-externc-isystem ../../build/linux/debian_sid_amd64-sysroot/usr/include -O2 -Wno-builtin-macro-redefined -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-null-pointer-arithmetic -Wno-ignored-pragma-optimize -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-char-subscripts -Wglobal-constructors -Wexit-time-destructors -Wshadow -Wexit-time-destructors -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /b/s/w/ir/cache/builder/src/out/Release -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden -pthread -stack-protector 1 -stack-protector-buffer-size 4 -fno-rtti -fno-use-cxa-atexit -fobjc-runtime=gcc -Qn -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -instcombine-lower-dbg-declare=0 -load ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -add-plugin find-bad-constructs -plugin-arg-find-bad-constructs enforce-in-thirdparty-webkit -plugin-arg-find-bad-constructs check-enum-max-value -plugin-arg-find-bad-constructs check-ipc -mllvm -limited-coverage-experimental=true -o obj/base/base/trace_event_impl.o -x c++ ../../base/trace_event/trace_event_impl.cc -fcomplete-member-pointers -faddrsig
1.	../../base/trace_event/trace_event_impl.cc:487:1: current parser token 'namespace'
2.	../../base/trace_event/trace_event_impl.cc:22:11: LLVM IR generation of declaration 'base'
3.	../../base/trace_event/trace_event_impl.cc:63:25: Generating code for declaration 'base::trace_event::TraceEvent::operator='
#0 0x00000000021cabf4 (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x21cabf4)
#1 0x00000000021c8a8e llvm::sys::RunSignalHandlers() (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x21c8a8e)
#2 0x00000000021cadb8 (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x21cadb8)
#3 0x00007fccb6cc6330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fccb5adec37 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x36c37)
#5 0x00007fccb5ae2028 abort (/lib/x86_64-linux-gnu/libc.so.6+0x3a028)
#6 0x00007fccb5ad7bf6 (/lib/x86_64-linux-gnu/libc.so.6+0x2fbf6)
#7 0x00007fccb5ad7ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00000000024aa4cf (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x24aa4cf)
#9 0x00000000024a747f (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x24a747f)
#10 0x00000000024aa195 (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x24aa195)
#11 0x00000000024a4756 (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x24a4756)
#12 0x00000000024a2afa clang::CodeGen::CoverageMappingGen::emitCounterMapping(clang::Decl const*, llvm::raw_ostream&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x24a2afa)
#13 0x000000000247ef10 clang::CodeGen::CodeGenPGO::emitCounterRegionMapping(clang::Decl const*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x247ef10)
#14 0x000000000247eb70 clang::CodeGen::CodeGenPGO::assignRegionCounters(clang::GlobalDecl, llvm::Function*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x247eb70)
#15 0x000000000242a4e4 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x242a4e4)
#16 0x000000000244671a clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x244671a)
#17 0x000000000243ecad clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x243ecad)
#18 0x000000000244a23c clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x244a23c)
#19 0x000000000244df3b clang::CodeGen::CodeGenModule::EmitDeclContext(clang::DeclContext const*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x244df3b)
#20 0x000000000244df3b clang::CodeGen::CodeGenModule::EmitDeclContext(clang::DeclContext const*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x244df3b)
#21 0x0000000002c05cb0 (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x2c05cb0)
#22 0x0000000002c02f3b (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x2c02f3b)
#23 0x000000000289e1a0 clang::MultiplexConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x289e1a0)
#24 0x000000000341baf3 clang::ParseAST(clang::Sema&, bool, bool) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x341baf3)
#25 0x0000000002866b70 clang::FrontendAction::Execute() (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x2866b70)
#26 0x000000000280e051 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x280e051)
#27 0x0000000002906fbd clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x2906fbd)
#28 0x00000000008f6818 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x8f6818)
#29 0x00000000008f3ff5 main (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x8f3ff5)
#30 0x00007fccb5ac9f45 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f45)
#31 0x00000000008f0fed _start (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x8f0fed)
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 8.0.0 (trunk 346388)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: ../../third_party/llvm-build/Release+Asserts/bin
clang++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: /tmp/trace_event_impl-74149b.cpp
clang++: note: diagnostic msg: /tmp/trace_event_impl-74149b.sh
clang++: note: diagnostic msg:

********************
 
I'm gonna to revert https://chromium-review.googlesource.com/c/chromium/src/+/1346305 for now.

rnk@, thakis@: any suggestion to workaround the bug with some code change?
Status: Assigned (was: Unconfirmed)
Cc: infe...@chromium.org mmoroz@chromium.org
I think mmoroz owns code coverage.
Now it's my team own code coverage since Oct 1 :)
Labels: -Pri-2 Pri-1
feel free to revert https://chromium-review.googlesource.com/c/chromium/src/+/1346305, we shouldn't allow any new code to regress the code coverage bots.
It was reverted an hour ago. Thing should be green now.
I can reproduce this LLVM crash locally (and thus get the preprocessed and launcher script as well, attached here). However, trying to file a bug for LLVM, I need a login and see this message:

"New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name."

Email has been sent. Waiting for answer :)

trace_event_impl-79513d.backtrace
9.0 KB Download
trace_event_impl-79513d.cpp
5.6 MB View Download
trace_event_impl-79513d.sh
10.1 KB View Download
Labels: -Pri-1 Pri-3
Summary: llvm: Crash when building base/trace_event/trace_event_impl.cc with coverage intrumentation (was: tFailed to compile base/trace_event/trace_event_impl.cc with coverage intrumentation)
Upstream LLVM bug has now been filed as https://bugs.llvm.org/show_bug.cgi?id=39822

Since the offending CL is not time-criticial and has been reverted, I'm switching this to Priority 3 and changing the issue's title to track the llvm bug instead.


Thanks digit@!
Blocking: 904337
Should be fixed upstream now as per https://reviews.llvm.org/rL347803. Blocked on the next (or next-to-next) clang roll.
Owner: digit@chromium.org
Just changing my email address :)
Blockedon: 904337
Blocking: -904337
s/blocking/blocked on/
For the record, a new version of trace_event_impl.cc that works around the issue has been submitted here [1], so this bug no longer applies, though it would be nice if the same issue never rears its ugly head in the future, with the help of a clang DEPS roll :-)

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1353929
Status: Fixed (was: Assigned)
This should be better now.
Many thanks for fixing this and improving clang/llvm!
Status: Verified (was: Fixed)
Thanks!

Sign in to add a comment