[clazy] [Bug 370609] New: Crash with a simple template class and auto for loop

Csaba Kertész via KDE Bugzilla bugzilla_noreply at kde.org
Wed Oct 12 23:24:44 BST 2016


https://bugs.kde.org/show_bug.cgi?id=370609

            Bug ID: 370609
           Summary: Crash with a simple template class and auto for loop
           Product: clazy
           Version: unspecified
          Platform: Ubuntu Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: crash
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: csaba.kertesz at gmail.com
                CC: smartins at kde.org

Compile the following code snippet with the bleeding edge clazy and clang 3.8
or 3.9:

clazy -std=gnu++11 -o example.cpp.o -c example.cpp

example.cpp:

#include <vector>

template <typename T>
struct Example
{
  Example()
  {
    for (auto sample : SampleCache)
    {
    }
  }

  std::vector<float> SampleCache;
};

void CreateExample()
{
    new Example<int>();
}



Reproducible: Always

Steps to Reproduce:
1.  Compile example.cpp with Clazy.


Actual Results:  
Crash.

Expected Results:  
Clazy should not crash.

The code compiles fine with clang, only Clazy crashes.

Stack trace:

#0 0x00007fc2896c7c68 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x67fc68)
#1 0x00007fc2896c5dde llvm::sys::RunSignalHandlers()
(/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x67ddde)
#2 0x00007fc2896c5f2c (/usr/lib/x86_64-linux-gnu/libLLVM-3.9.so.1+0x67df2c)
#3 0x00007fc28bc113d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x113d0)
#4 0x000000000154c18b clang::ASTContext::getTypeInfoImpl(clang::Type const*)
const (/usr/lib/llvm-3.9/bin/clang+0x154c18b)
#5 0x000000000154332c clang::ASTContext::getTypeInfo(clang::Type const*) const
(/usr/lib/llvm-3.9/bin/clang+0x154332c)
#6 0x00007fc285d06ebc TypeUtils::classifyQualType(clang::CompilerInstance
const&, clang::VarDecl const*, TypeUtils::QualTypeClassification&,
clang::Stmt*) (/usr/lib/x86_64-linux-gnu/libclazylib.so.0+0x126ebc)
#7 0x00007fc2865b3032
RangeLoop::checkPassByConstRefCorrectness(clang::CXXForRangeStmt*)
(/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x34b032)
#8 0x00007fc2865b2dd9 RangeLoop::processForRangeLoop(clang::CXXForRangeStmt*)
(/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x34add9)
#9 0x00007fc2865dbe1c (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x373e1c)
#10 0x00007fc2865d4a22 (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x36ca22)
#11 0x00007fc2865d1b61 (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x369b61)
#12 0x00007fc2865dce97 (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x374e97)
#13 0x00007fc2865cfd3d (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x367d3d)
#14 0x00007fc2865cf2a3 (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x3672a3)
#15 0x00007fc2865cec45 (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x366c45)
#16 0x00007fc2865d0b04 (/usr/lib/x86_64-linux-gnu/ClangLazy.so+0x368b04)
#17 0x0000000000a5e648
clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/lib/llvm-3.9/bin/clang+0xa5e648)
#18 0x0000000000c613fa clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib/llvm-3.9/bin/clang+0xc613fa)
#19 0x0000000000a376be clang::FrontendAction::Execute()
(/usr/lib/llvm-3.9/bin/clang+0xa376be)
#20 0x0000000000a0a056
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib/llvm-3.9/bin/clang+0xa0a056)
#21 0x0000000000ab2612
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib/llvm-3.9/bin/clang+0xab2612)
#22 0x0000000000714968 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-3.9/bin/clang+0x714968)
#23 0x0000000000707f2a main (/usr/lib/llvm-3.9/bin/clang+0x707f2a)
#24 0x00007fc2881b0830 __libc_start_main
/build/glibc-GKVZIf/glibc-2.23/csu/../csu/libc-start.c:325:0
#25 0x0000000000712d39 _start (/usr/lib/llvm-3.9/bin/clang+0x712d39)
Stack dump:
0.      Program arguments: /usr/lib/llvm-3.9/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name example.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debugger-tuning=gdb -coverage-file
/home/build/aiboplus/aiboplus/mindcommon/tests/example.cpp.o -resource-dir
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1 -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=gnu++11 -fdeprecated-macro
-fdebug-compilation-dir /home/build/aiboplus/aiboplus/mindcommon/tests
-ferror-limit 19 -fmessage-length 179 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -load ClangLazy.so
-add-plugin clang-lazy -o example.cpp.o -x c++ example.cpp 
1.      <eof> parser at end of file
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.1-svn281634-1~exp1 (branches/release_39)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
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.
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/example-f563a4.cpp
clang: note: diagnostic msg: /tmp/example-f563a4.sh
clang: note: diagnostic msg: 

********************

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Unassigned-bugs mailing list