Closed Bug 1514801 Opened 2 years ago Closed 2 years ago

clang.exe: error: clang frontend command failed due to signal (mozilla plugin crash)

Categories

(Firefox Build System :: Source Code Analysis, defect, P2)

defect

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mayhemer, Assigned: andi)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Please see this try push:

https://treeherder.mozilla.org/#/jobs?repo=try&searchStr=build&selectedJob=217439869&revision=0aa0eeaf5d8170b9fc3c0f37096af40ab4d718f3

15:20:47     INFO -  z:/build/build/src/clang/bin/clang.exe --driver-mode=cl -fms-compatibility-version=19.15.26726 -m32 -FonsRefreshDriver.i_o -c  -Iz:/build/build/src/obj-firefox/dist/stl_wrappers -DNDEBUG=1 -DTRIMMED=1 -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DOS_WIN=1 -D_UNICODE -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DUNICODE -D_WINDOWS -D_SECURE_ATL -DCOMPILER_MSVC -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -Iz:/build/build/src/layout/base -Iz:/build/build/src/obj-firefox/layout/base -Iz:/build/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -Iz:/build/build/src/ipc/chromium/src -Iz:/build/build/src/ipc/glue -Iz:/build/build/src/layout/forms -Iz:/build/build/src/layout/generic -Iz:/build/build/src/layout/mathml -Iz:/build/build/src/layout/painting -Iz:/build/build/src/layout/printing -Iz:/build/build/src/layout/style -Iz:/build/build/src/layout/svg -Iz:/build/build/src/layout/tables -Iz:/build/build/src/layout/xul -Iz:/build/build/src/layout/xul/tree -Iz:/build/build/src/docshell/base -Iz:/build/build/src/dom/base -Iz:/build/build/src/dom/html -Iz:/build/build/src/dom/svg -Iz:/build/build/src/dom/xbl -Iz:/build/build/src/dom/xul -Iz:/build/build/src/view -Iz:/build/build/src/obj-firefox/dist/include -Iz:/build/build/src/obj-firefox/dist/include/nspr -Iz:/build/build/src/obj-firefox/dist/include/nss -MD -FI z:/build/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -Qunused-arguments -TP -nologo -w15038 -wd5026 -wd5027 -Zc:sizedDealloc- -wd4091 -wd4577 -D_HAS_EXCEPTIONS=0 -W3 -Gy -Zc:inline -arch:SSE2 -Gw -wd4251 -wd4244 -wd4267 -wd4800 -wd4595 -wd4065 -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -we4553 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Zi -Xclang -load -Xclang z:/build/build/src/obj-firefox/build/clang-plugin/clang-plugin.dll -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -WX -wd4312 -fprofile-instr-generate -Xclang -finstrument-functions-after-inlining -Xclang -MP -Xclang -dependency-file -Xclang .deps/nsRefreshDriver.i_o.pp -Xclang -MT -Xclang nsRefreshDriver.i_o  -Fdgenerated.pdb -FS  z:/build/build/src/layout/base/nsRefreshDriver.cpp
15:20:47     INFO -  Wrote crash dump file "C:\Users\task_1545057164\AppData\Local\Temp\clang.exe-997622.dmp"
15:20:47     INFO -  LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure the file exists and is readable.  Calling loadDataForExe
15:20:47     INFO -  LLVMSymbolizer: error reading file: PDB Error: Unable to load PDB.  Make sure the file exists and is readable.  Calling loadDataForExe
15:20:47     INFO -  #0 0x00007ff96eb0b88e (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x2b88e)
15:20:47     INFO -  #1 0x00007ff96eb52683 (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x72683)
15:20:47     INFO -  #2 0x00007ff96eb34e8d (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x54e8d)
15:20:47     INFO -  #3 0x00007ff96eb51d3d (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x71d3d)
15:20:47     INFO -  #4 0x00007ff96eb6970e (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x8970e)
15:20:47     INFO -  #5 0x00007ff96eb5b291 (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x7b291)
15:20:47     INFO -  #6 0x00007ff96eb6dac3 (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x8dac3)
15:20:47     INFO -  #7 0x00007ff96eb55f5f (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x75f5f)
15:20:47     INFO -  #8 0x00007ff96eb5745d (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x7745d)
15:20:47     INFO -  #9 0x00007ff96eb38aa1 (z:\build\build\src\obj-firefox\build\clang-plugin\clang-plugin.dll+0x58aa1)
15:20:47     INFO -  #10 0x00007ff7efd25fbc clang::MultiplexConsumer::HandleTranslationUnit(class clang::ASTContext &) (z:\build\build\src\clang\bin\clang.exe+0x13a5fbc)
15:20:47     INFO -  #11 0x00007ff7f05ff294 clang::ParseAST(class clang::Sema &,bool,bool) (z:\build\build\src\clang\bin\clang.exe+0x1c7f294)
15:20:47     INFO -  #12 0x00007ff7efcf3f7d clang::FrontendAction::Execute(void) (z:\build\build\src\clang\bin\clang.exe+0x1373f7d)
15:20:47     INFO -  #13 0x00007ff7efcb8947 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) (z:\build\build\src\clang\bin\clang.exe+0x1338947)
15:20:47     INFO -  #14 0x00007ff7efd5a0ec clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) (z:\build\build\src\clang\bin\clang.exe+0x13da0ec)
15:20:47     INFO -  #15 0x00007ff7ee986cf2 std::_Tree<class std::_Tmap_traits<struct llvm::MCContext::COFFSectionKey,class llvm::MCSectionCOFF *,struct std::less<struct llvm::MCContext::COFFSectionKey>,class std::allocator<struct std::pair<struct llvm::MCContext::COFFSectionKey const ,class llvm::MCSectionCOFF *> >,0> >::erase(class std::_Tree_const_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<struct llvm::MCContext::COFFSectionKey const ,class llvm::MCSectionCOFF *> > > >) (z:\build\build\src\clang\bin\clang.exe+0x6cf2)
15:20:47     INFO -  #16 0x00007ff7ee9841cc (z:\build\build\src\clang\bin\clang.exe+0x41cc)
15:20:47     INFO -  #17 0x00007ff7f15253bd llvm::microsoftDemangle(char const *,char *,unsigned __int64 *,int *) (z:\build\build\src\clang\bin\clang.exe+0x2ba53bd)
15:20:47     INFO -  #18 0x00007ff9731613d2 (C:\Windows\system32\KERNEL32.DLL+0x13d2)
15:20:47     INFO -  #19 0x00007ff9750554e4 (C:\Windows\SYSTEM32\ntdll.dll+0x154e4)
15:20:47     INFO -  clang.exe: error: clang frontend command failed due to signal (use -v to see invocation)
15:20:47     INFO -  clang version 7.0.0 (tags/RELEASE_700/final 342383)
15:20:47     INFO -  Target: i386-pc-windows-msvc
15:20:47     INFO -  Thread model: posix
15:20:47     INFO -  InstalledDir: z:/build/build/src/clang/bin
15:20:47     INFO -  clang.exe: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
15:20:47     INFO -  clang.exe: note: diagnostic msg:
15:20:47     INFO -  ********************
15:20:47     INFO -  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
15:20:47     INFO -  Preprocessed source(s) and associated run script(s) are located at:
15:20:47     INFO -  clang.exe: note: diagnostic msg: C:\Users\task_1545057164\AppData\Local\Temp\nsRefreshDriver-0c4316.cpp
15:20:47     INFO -  clang.exe: note: diagnostic msg: C:\Users\task_1545057164\AppData\Local\Temp\nsRefreshDriver-0c4316.sh
15:20:47     INFO -  clang.exe: note: diagnostic msg:
15:20:47     INFO -  ********************
15:20:47     INFO -  z:/build/build/src/config/rules.mk:1131: recipe for target 'nsRefreshDriver.i_o' failed
15:20:47     INFO -  mozmake.EXE[5]: *** [nsRefreshDriver.i_o] Error 1
15:20:47     INFO -  mozmake.EXE[5]: Leaving directory 'z:/build/build/src/obj-firefox/layout/base'


My local build doesn't repro this crash and is the following:

$clang-cl.exe --version
clang version 7.0.0 (tags/RELEASE_700/final 342383)
Target: x86_64-pc-windows-msvc
Thread model: posix

OK, my local clang is x64.
This is crashing in our clang plugin. It looks like we don't build it with debug symbols?
Component: General → Source Code Analysis
Guys, do you see any possible progress here?  I would like to start people giving Backtrack enabled builds to experiment with.  This is a total blocker.  But definitely can wait until the new year ;)  Thanks.

Andi, can you reproduce this issue?

Flags: needinfo?(bpostelnicu)
Priority: -- → P2

No, unfortunately I cannot, and neither looking other the build artifacts that we have for this crash. Indeed we don't build with debug symbols, but maybe because they are stripped since we do pgo and opt?
Anyway this shouldn't be a blocker you can just disable static-analysis altogether.
mayhemer have you tried this?

Flags: needinfo?(bpostelnicu) → needinfo?(honzab.moz)
Blocks: 1538241
Attached patch workaroundSplinter Review

The E->getType()-> dereference returns null, there is no type for the expression.

Assignee: nobody → honzab.moz
Flags: needinfo?(honzab.moz)
Assignee: honzab.moz → bpostelnicu

I happens to me when I was using MacOS to build Android Firefox with optimized non-debug build, and the workaround patch doesn't work to me.

(In reply to Daosheng Mu[:daoshengmu] from comment #6)

I happens to me when I was using MacOS to build Android Firefox with optimized non-debug build, and the workaround patch doesn't work to me.

Log messages:

4:14.68 clang++: error: unable to execute command: Segmentation fault: 11
4:14.68 clang++: error: clang frontend command failed due to signal (use -v to see invocation)
4:14.69 Android (4691093 based on r316199) clang version 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55536e7d904e0abae47888fc7f) (https://android.googlesource.com/toolchain/llvm 34361f192e41ed6e4e8f9aca80a4ea7e9856f327) (based on LLVM 6.0.2svn)
4:14.69 Target: arm--linux-android
4:14.69 Thread model: posix
4:14.69 InstalledDir: /Users/daoshengmu/.mozbuild/android-ndk-r17b/toolchains/llvm/prebuilt/darwin-x86_64/bin
4:14.69 clang++: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
4:15.08 clang++: note: diagnostic msg:
4:15.08 ********************
4:15.08 PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
4:15.08 Preprocessed source(s) and associated run script(s) are located at:
4:15.08 clang++: note: diagnostic msg: /var/folders/jt/42zfccf178q5h8nknxgft5fr0000gn/T/Unified_cpp_js_src_jit4-b359d3.cpp
4:15.08 clang++: note: diagnostic msg: /var/folders/jt/42zfccf178q5h8nknxgft5fr0000gn/T/Unified_cpp_js_src_jit4-b359d3.sh
4:15.08 clang++: note: diagnostic msg: Crash backtrace is located in
4:15.08 clang++: note: diagnostic msg: /Users/daoshengmu/Library/Logs/DiagnosticReports/clang++_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
4:15.08 clang++: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
4:15.08 clang++: note: diagnostic msg:
4:15.08 ********************
4:15.08 make[4]: *** [Unified_cpp_js_src_jit4.o] Error 254
4:15.08 make[4]: *** Waiting for unfinished jobs....

Summary: clang.exe: error: clang frontend command failed due to signal → clang.exe: error: clang frontend command failed due to signal (mozilla plugin crash)
Duplicate of this bug: 1538241

It is possible that in that particular case QualType doesn't point yet to a Type so verifying it's sanity it's legit, but a refactoring to this checker should be more appropriate so most of the refinement of the matching should be done from the actual matcher and not after the matcher matched a node and after that we discard that mode.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e10f68746cd91ad273ba007ef5d04722a4837fec

Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3554b78bd8f0
refactor clang based checker - KungFuDeathGripChecker. r=glandium
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Regressions: 1567142
You need to log in before you can comment on or make changes to this bug.