ToTWin builds fail with "Wrong type in array element initializer" assert |
|||
Issue descriptionExample build: https://ci.chromium.org/buildbot/chromium.clang/ToTWin/1555
,
May 23 2018
Stack etc.
clang: ../lib/IR/Constants.cpp:963: static llvm::Constant* llvm::ConstantArray::getImpl(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>): Assertion `V[i]->getType() == Ty->getElementType() && "Wrong type in array element initializer"' failed.
Stack dump:
0. Program arguments: bin/clang -cc1 -triple x86_64-pc-windows-msvc19.11.0 -emit-obj -disable-free -main-file-name image_writer_win.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -fmerge-all-constants -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -mllvm -x86-asm-syntax=intel -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames --show-includes -fno-rtti-data -stack-protector 2 -gcodeview -fms-volatile -fdiagnostics-format msvc -gcodeview -debug-info-kind=limited -debugger-tuning=gdb -momit-leaf-frame-pointer -ffunction-sections -fdata-sections -coverage-notes-file C:\src\chromium\src\out\release\image_writer_win.gcno -nostdsysteminc -D V8_DEPRECATION_WARNINGS -D USE_AURA=1 -D NO_TCMALLOC -D FULL_SAFE_BROWSING -D SAFE_BROWSING_CSD -D SAFE_BROWSING_DB_LOCAL -D CHROMIUM_BUILD -D FIELDTRIAL_TESTING_ENABLED -D _HAS_EXCEPTIONS=0 -D __STD_C -D _CRT_RAND_S -D _CRT_SECURE_NO_DEPRECATE -D _SCL_SECURE_NO_DEPRECATE -D DEPRECATEDENUMERATOR(x)=[[deprecated(x)]] -D _ATL_NO_OPENGL -D _WINDOWS -D CERT_CHAIN_PARA_HAS_EXTRA_FIELDS -D PSAPI_VERSION=1 -D WIN32 -D _SECURE_ATL -D _USING_V110_SDK71_ -D WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D WIN32_LEAN_AND_MEAN -D NOMINMAX -D _UNICODE -D UNICODE -D NTDDI_VERSION=0x0A000002 -D _WIN32_WINNT=0x0A00 -D WINVER=0x0A00 -D NDEBUG -D NVALGRIND -D DYNAMIC_ANNOTATIONS_ENABLED=0 -D WEBP_EXTERN=extern -D USE_EGL -D TOOLKIT_VIEWS=1 -D U_USING_ICU_NAMESPACE=0 -D U_ENABLE_DYLOAD=0 -D U_STATIC_IMPLEMENTATION -D ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -D UCHAR_TYPE=wchar_t -D ENABLE_IPC_FUZZER -D GOOGLE_PROTOBUF_NO_RTTI -D GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -D V8_USE_EXTERNAL_STARTUP_DATA -D SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -D SK_HAS_PNG_LIBRARY -D SK_HAS_WEBP_LIBRARY -D SK_HAS_JPEG_LIBRARY -D SK_SUPPORT_GPU=1 -D SK_GPU_WORKAROUNDS_HEADER="gpu/config/gpu_driver_bug_workaround_autogen.h" -D GR_GL_FUNCTION_TYPE=__stdcall -D LEVELDB_PLATFORM_CHROMIUM=1 -D DeleteFile=DeleteFileW -D OS_WIN -D WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -D GTEST_RELATIVE_PATH -D WEBRTC_CHROMIUM_BUILD -D WEBRTC_WIN -D NO_MAIN_THREAD_WRAPPING -D MESA_EGL_NO_X11_HEADERS -D __DATE__= -D __TIME__= -D __TIMESTAMP__= -D LIBXML_STATIC= -Os -Wno-builtin-macro-redefined -WCL4 -Wimplicit-fallthrough -Wthread-safety -Werror -Wno-unused-parameter -Wno-deprecated-declarations -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-ignored-pragma-optimize -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-inconsistent-missing-override -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.11 -std=c++14 -fdelayed-template-parsing -finline-functions -fobjc-runtime=gcc -fseh-exceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -mllvm -instcombine-lower-dbg-declare=0 -x c++ /usr/local/google/home/hwennborg/Downloads/image_writer_win-42efa5.cpp
1. <eof> parser at end of file
2. ../../chrome/utility/image_writer/image_writer_win.cc:13:11: LLVM IR generation of declaration 'image_writer'
3. ../../chrome/utility/image_writer/image_writer_win.cc:74:19: Generating code for declaration 'image_writer::ImageWriter::UnmountVolumes'
4. ../../chrome/utility/image_writer/image_writer_win.cc:109:68: LLVM IR generation of compound statement ('{}')
#0 0x0000556b287862ea llvm::sys::PrintStackTrace(llvm::raw_ostream&) (bin/clang+0x24de2ea)
#1 0x0000556b28784774 llvm::sys::RunSignalHandlers() (bin/clang+0x24dc774)
#2 0x0000556b287848a2 SignalHandler(int) (bin/clang+0x24dc8a2)
#3 0x00007fb7acad10c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#4 0x00007fb7ab662fcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#5 0x00007fb7ab6643fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#6 0x00007fb7ab65be37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#7 0x00007fb7ab65bee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#8 0x0000556b2819d895 llvm::ConstantArray::getImpl(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>) (bin/clang+0x1ef5895)
#9 0x0000556b281a0d8f llvm::ConstantArray::get(llvm::ArrayType*, llvm::ArrayRef<llvm::Constant*>) (bin/clang+0x1ef8d8f)
#10 0x0000556b2899bc27 (anonymous namespace)::EmitArrayConstant(llvm::ArrayType*, llvm::Type*, unsigned int, llvm::SmallVectorImpl<llvm::Constant*>&, llvm::Constant*) (bin/clang+0x26f3c27)
#11 0x0000556b289a20d9 clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::APValue const&, clang::QualType) (bin/clang+0x26fa0d9)
#12 0x0000556b289a3366 clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::APValue const&, clang::QualType) (bin/clang+0x26fb366)
#13 0x0000556b289a39b4 (anonymous namespace)::ConstStructBuilder::Build(clang::APValue const&, clang::RecordDecl const*, bool, clang::CXXRecordDecl const*, clang::CharUnits) (bin/clang+0x26fb9b4)
#14 0x0000556b289a21a1 clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::APValue const&, clang::QualType) (bin/clang+0x26fa1a1)
#15 0x0000556b289a3366 clang::CodeGen::ConstantEmitter::tryEmitPrivateForMemory(clang::APValue const&, clang::QualType) (bin/clang+0x26fb366)
#16 0x0000556b289a5fae clang::CodeGen::ConstantEmitter::tryEmitPrivateForVarInit(clang::VarDecl const&) (bin/clang+0x26fdfae)
#17 0x0000556b289a6106 clang::CodeGen::ConstantEmitter::tryEmitAbstractForInitializer(clang::VarDecl const&) (bin/clang+0x26fe106)
#18 0x0000556b28b5f7d1 clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission const&) (bin/clang+0x28b77d1)
#19 0x0000556b28b64485 clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&) (bin/clang+0x28bc485)
#20 0x0000556b28b645fb clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&) (bin/clang+0x28bc5fb)
#21 0x0000556b28b64811 clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) (bin/clang+0x28bc811)
#22 0x0000556b289b4d7f clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) (bin/clang+0x270cd7f)
#23 0x0000556b289c132b clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (bin/clang+0x271932b)
#24 0x0000556b289bd980 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (bin/clang+0x2715980)
#25 0x0000556b289be0a3 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (bin/clang+0x27160a3)
#26 0x0000556b289be3ad clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (bin/clang+0x27163ad)
#27 0x0000556b289c1373 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) (bin/clang+0x2719373)
#28 0x0000556b289bd980 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (bin/clang+0x2715980)
#29 0x0000556b289beca8 clang::CodeGen::CodeGenFunction::EmitWhileStmt(clang::WhileStmt const&, llvm::ArrayRef<clang::Attr const*>) (bin/clang+0x2716ca8)
#30 0x0000556b289bdb49 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (bin/clang+0x2715b49)
#31 0x0000556b289be0a3 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (bin/clang+0x27160a3)
#32 0x0000556b289f6e1d clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&, clang::Stmt const*) (bin/clang+0x274ee1d)
#33 0x0000556b28a03716 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (bin/clang+0x275b716)
#34 0x0000556b28a2bb76 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (bin/clang+0x2783b76)
#35 0x0000556b28a3dfc3 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (bin/clang+0x2795fc3)
#36 0x0000556b28a3eff8 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (bin/clang+0x2796ff8)
#37 0x0000556b28a3fb95 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.6450) (bin/clang+0x2797b95)
#38 0x0000556b28a40176 clang::CodeGen::CodeGenModule::EmitDeclContext(clang::DeclContext const*) (bin/clang+0x2798176)
#39 0x0000556b28a3f859 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.6450) (bin/clang+0x2797859)
#40 0x0000556b2910d5fd (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (bin/clang+0x2e655fd)
#41 0x0000556b29102c5d clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (bin/clang+0x2e5ac5d)
#42 0x0000556b298dd153 clang::ParseAST(clang::Sema&, bool, bool) (bin/clang+0x3635153)
#43 0x0000556b2910ab20 clang::CodeGenAction::ExecuteAction() (bin/clang+0x2e62b20)
#44 0x0000556b28da5efe clang::FrontendAction::Execute() (bin/clang+0x2afdefe)
#45 0x0000556b28d6ce4e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (bin/clang+0x2ac4e4e)
#46 0x0000556b28e43a9b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (bin/clang+0x2b9ba9b)
#47 0x0000556b26ee8c38 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (bin/clang+0xc40c38)
#48 0x0000556b26e67735 main (bin/clang+0xbbf735)
#49 0x00007fb7ab6502b1 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#50 0x0000556b26ee5f2a _start (bin/clang+0xc3df2a)
,
May 23 2018
It's this one: ------------------------------------------------------------------------ r333044 | rsmith | 2018-05-23 02:09:29 +0200 (Wed, 23 May 2018) | 20 lines Use zeroinitializer for (trailing zero portion of) large array initializers more reliably. Clang has two different ways it emits array constants (from InitListExprs and from APValues), and both had some ability to emit zeroinitializer, but neither was able to catch all cases where we could use zeroinitializer reliably. In particular, emitting from an APValue would fail to notice if all the explicit array elements happened to be zero. In addition, for large arrays where only an initial portion has an explicit initializer, we would emit the complete initializer (which could be huge) rather than emitting only the non-zero portion. With this change, when the element would have a suffix of more than 8 zero elements, we emit the array constant as a packed struct of its initial portion followed by a zeroinitializer constant for the trailing zero portion. In passing, I found a bug where SemaInit would sometimes walk the entire array when checking an initializer that only covers the first few elements; that's fixed here to unblock testing of the rest. Differential Revision: https://reviews.llvm.org/D47166 ------------------------------------------------------------------------
,
May 23 2018
Reverted in r333067
,
May 23 2018
LLVM-side bug: https://bugs.llvm.org/show_bug.cgi?id=37560 Closing here since the revert is in. |
|||
►
Sign in to add a comment |
|||
Comment 1 by h...@chromium.org
, May 23 201811.1 MB
11.1 MB View Download