llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.97k stars 11.54k forks source link

Regression(289703): Assertion failed: (memvt.getStoreSize() <= MMO->getSize() && "Size mismatch!") when building chrome/ios. #30752

Closed nico closed 7 years ago

nico commented 7 years ago
Bugzilla Link 31404
Resolution FIXED
Resolved on Dec 16, 2016 12:45
Version trunk
OS All
Attachments repro
CC @efriedma-quic

Extended Description

Repro coming in a sec

efriedma-quic commented 7 years ago

r289972. (I'm glad the assertion caught this; it would have been a painful miscompile to track down.)

nico commented 7 years ago

Smaller:

CC=$HOME/src/llvm-build-nolibcxx/bin/clang $CC "-cc1" "-triple" "thumbv7-apple-ios9.0.0" "-emit-obj" "-relaxed-aliasing" "-O2" "-vectorize-loops" "-x" "c" "foo.ii" 2>&1

$ cat foo.ii typedef signed char int8_t; typedef unsigned char uint8_t; typedef unsigned int uint32_t; typedef struct { uint8_t green_tored; uint8_t green_toblue; uint8_t red_toblue; } VP8LMultipliers; static inline uint32_t ColorTransformDelta(int8_t color_pred, int8_t color) { return (uint32_t)((int)(color_pred)color) >> 5; } void VP8LTransformColorInverse_C(const VP8LMultipliers const m, uint32_t* data, int num_pixels) { int i; for (i = 0; i < num_pixels; ++i) { const uint32_t argb = data[i]; const uint32_t green = argb >> 8; const uint32_t red = argb >> 16; uint32_t new_red = red; uint32_t new_blue = argb; new_red += ColorTransformDelta(m->green_tored, green); new_blue += ColorTransformDelta(m->red_toblue, new_red); data[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue); } }

nico commented 7 years ago

full stack

thakis@thakis:~/src/llvm-build-nolibcxx$ ./lossless-7ea032.sh clang: /usr/local/google/home/thakis/src/llvm-rw/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:6973: llvm::MemSDNode::MemSDNode(unsigned int, unsigned int, const llvm::DebugLoc&, llvm::SDVTList, llvm::EVT, llvm::MachineMemOperand*): Assertion `memvt.getStoreSize() <= MMO->getSize() && "Size mismatch!"' failed.

​0 0x0000000001d62b25 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x1d62b25)

​1 0x0000000001d60b3e llvm::sys::RunSignalHandlers() (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x1d60b3e)

​2 0x0000000001d60ca2 SignalHandler(int) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x1d60ca2)

​3 0x00007fc6f49af330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)

​4 0x00007fc6f37aac37 gsignal /build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0

​5 0x00007fc6f37ae028 abort /build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0

​6 0x00007fc6f37a3bf6 __assert_fail_base /build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0

​7 0x00007fc6f37a3ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)

​8 0x000000000240d57c (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x240d57c)

​9 0x000000000241001d llvm::SelectionDAG::getMemIntrinsicNode(unsigned int, llvm::SDLoc const&, llvm::SDVTList, llvm::ArrayRef, llvm::EVT, llvm::MachineMemOperand*) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x241001d)

​10 0x0000000000de9fba CombineBaseUpdate(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0xde9fba)

​11 0x0000000000e0c592 llvm::ARMTargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0xe0c592)

​12 0x000000000238e1e7 (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x238e1e7)

​13 0x000000000238f83b llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults&, llvm::CodeGenOpt::Level) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x238f83b)

​14 0x0000000002446234 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x2446234)

​15 0x000000000244e620 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x244e620)

​16 0x000000000245085c llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone .part.958] (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x245085c)

​17 0x0000000000dcadc4 (anonymous namespace)::ARMDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0xdcadc4)

​18 0x00000000017131c3 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x17131c3)

​19 0x00000000019c28f3 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x19c28f3)

​20 0x00000000019c299c llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x19c299c)

​21 0x00000000019c31ff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x19c31ff)

​22 0x0000000001ed38b2 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete >) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x1ed38b2)

​23 0x0000000001ed5751 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete >) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x1ed5751)

​24 0x000000000250632b clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x250632b)

​25 0x00000000028f97e2 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x28f97e2)

​26 0x000000000250146e clang::CodeGenAction::ExecuteAction() (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x250146e)

​27 0x000000000220a8d6 clang::FrontendAction::Execute() (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x220a8d6)

​28 0x00000000021e47b6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x21e47b6)

​29 0x000000000229374a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0x229374a)

​30 0x0000000000acbdd8 cc1_main(llvm::ArrayRef<char const>, char const, void*) (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0xacbdd8)

​31 0x0000000000a6c7b1 main (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0xa6c7b1)

​32 0x00007fc6f3795f45 __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0

​33 0x0000000000ac7e9e _start (/usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang+0xac7e9e)

Stack dump:

  1. Program arguments: /usr/local/google/home/thakis/src/llvm-build-nolibcxx/bin/clang -cc1 -triple thumbv7-apple-ios9.0.0 -emit-obj -disable-free -main-file-name lossless.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -target-cpu cortex-a8 -target-feature +soft-float-abi -target-abi apcs-gnu -mfloat-abi soft -target-linker-version 253.3 -dwarf-column-info -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -coverage-notes-file /Users/justincohen/work/bling/src/out/Release-iphoneos/ios_clang_arm/obj/third_party/libwebp/libwebp_dsp/lossless.gcno -D V8_DEPRECATION_WARNINGS -D NO_TCMALLOC -D DISABLE_NACL -D CHROMIUM_BUILD -D FIELDTRIAL_TESTING_ENABLED -D CR_CLANG_REVISION=289864-1 -D CR_XCODE_VERSION=0800 -D NDEBUG -D NVALGRIND -D DYNAMIC_ANNOTATIONS_ENABLED=0 -O2 -Wheader-hygiene -Wstring-conversion -Werror -Wall -Wno-unused-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-incompatible-pointer-types -std=c99 -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -stack-protector 1 -stack-protector-buffer-size 4 -fallow-half-arguments-and-returns -fblocks -fobjc-runtime=ios-9.0.0 -fencode-extended-block-signature -fsjlj-exceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -x c lossless-7ea032.c
  2. parser at end of file
  3. Code generation
  4. Running pass 'Function Pass Manager' on module 'lossless-7ea032.c'.
  5. Running pass 'ARM Instruction Selection' on function '@VP8LTransformColorInverse_C' ./lossless-7ea032.sh: line 4: 44335 Aborted $CC "-cc1" "-triple" "thumbv7-apple-ios9.0.0" "-emit-obj" "-disable-free" "-main-file-name" "lossless.c" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-mdisable-fp-elim" "-relaxed-aliasing" "-masm-verbose" "-target-cpu" "cortex-a8" "-target-feature" "+soft-float-abi" "-target-abi" "apcs-gnu" "-mfloat-abi" "soft" "-target-linker-version" "253.3" "-dwarf-column-info" "-debug-info-kind=standalone" "-dwarf-version=2" "-debugger-tuning=lldb" "-coverage-notes-file" "/Users/justincohen/work/bling/src/out/Release-iphoneos/ios_clang_arm/obj/third_party/libwebp/libwebp_dsp/lossless.gcno" "-D" "V8_DEPRECATION_WARNINGS" "-D" "NO_TCMALLOC" "-D" "DISABLE_NACL" "-D" "CHROMIUM_BUILD" "-D" "FIELDTRIAL_TESTING_ENABLED" "-D" "CR_CLANG_REVISION=289864-1" "-D" "CR_XCODE_VERSION=0800" "-D" "NDEBUG" "-D" "NVALGRIND" "-D" "DYNAMIC_ANNOTATIONS_ENABLED=0" "-O2" "-Wheader-hygiene" "-Wstring-conversion" "-Werror" "-Wall" "-Wno-unused-variable" "-Wno-missing-field-initializers" "-Wno-unused-parameter" "-Wno-c++11-narrowing" "-Wno-covered-switch-default" "-Wno-deprecated-register" "-Wno-unneeded-internal-declaration" "-Wno-inconsistent-missing-override" "-Wno-shift-negative-value" "-Wno-undefined-var-template" "-Wno-nonportable-include-path" "-Wno-address-of-packed-member" "-Wno-incompatible-pointer-types" "-std=c99" "-ferror-limit" "19" "-fmessage-length" "0" "-fvisibility" "hidden" "-stack-protector" "1" "-stack-protector-buffer-size" "4" "-fallow-half-arguments-and-returns" "-fblocks" "-fobjc-runtime=ios-9.0.0" "-fencode-extended-block-signature" "-fsjlj-exceptions" "-fmax-type-align=16" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-x" "c" "lossless-7ea032.c"
nico commented 7 years ago

It was 289703

thakis@thakis:~/src/llvm-rw$ svn merge -c -289703 . --- Reverse-merging r289703 into '.': U lib/Target/ARM/ARMISelLowering.h U lib/Target/ARM/ARMISelLowering.cpp U lib/Target/ARM/ARMISelDAGToDAG.cpp U test/CodeGen/ARM/vmul.ll U test/CodeGen/ARM/vlddup.ll --- Recording mergeinfo for reverse merge of r289703 into '.': U . thakis@thakis:~/src/llvm-rw$ svn commit -m 'Revert 279703, it caused llvm/llvm-project#30752 .' Sending lib/Target/ARM/ARMISelDAGToDAG.cpp Sending lib/Target/ARM/ARMISelLowering.cpp Sending lib/Target/ARM/ARMISelLowering.h Sending test/CodeGen/ARM/vlddup.ll Sending test/CodeGen/ARM/vmul.ll Transmitting file data ..... Committed revision 289923.