[llvm-bugs] [Bug 33724] New: clang++ 4.0.1 crashes on probably invalid input

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 10 00:14:55 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33724

            Bug ID: 33724
           Summary: clang++ 4.0.1 crashes on probably invalid input
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeffrey.donner at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Files are too large, they're at:

https://s3.amazonaws.com/jgd-public/line-thickness-bbac64.cpp
https://s3.amazonaws.com/jgd-public/line-thickness-bbac64.sh


/usr/local/llvm/bin/clang++  -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB
-I/mnt/raid/projects/shelf/c++/simulated-annealing/build
-I/mnt/raid/projects/shelf/c++/simulated-annealing
-I/mnt/raid/projects/shelf/c++/simulated-annealing/build/sa-app_autogen/include
-isystem /usr/local/qt-5/5.7/gcc_64/include -isystem
/usr/local/qt-5/5.7/gcc_64/include/QtWidgets -isystem
/usr/local/qt-5/5.7/gcc_64/include/QtGui -isystem
/usr/local/qt-5/5.7/gcc_64/include/QtCore -isystem
/usr/local/qt-5/5.7/gcc_64/./mkspecs/linux-g++  -Wall -Wextra -pedantic -fPIC
-g   -fPIC -pthread -std=gnu++1z -o
CMakeFiles/sa-app.dir/source/line-thickness.cpp.o -c
/mnt/raid/projects/shelf/c++/simulated-annealing/source/line-thickness.cpp
/mnt/raid/projects/shelf/c++/simulated-annealing/source/line-thickness.cpp:9:1:
error: 
      unknown type name 'ThicknessMap'
ThicknessMap g_thickness_map;
^
/mnt/raid/projects/shelf/c++/simulated-annealing/source/line-thickness.cpp:13:16:
error: 
      use of undeclared identifier 'bucket_of_value'
  int bucket = bucket_of_value(b);
               ^
clang-4.0:
/space/software/mkclang-4.0.1/llvm-4.0.1/tools/clang/include/clang/AST/DeclTemplate.h:1679:
void
clang::ClassTemplateSpecializationDecl::setPointOfInstantiation(clang::SourceLocation):
Assertion `Loc.isValid() && "point of instantiation must be valid!"' failed.
#0 0x0000000001a381e5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x1a381e5)
#1 0x0000000001a388b6 SignalHandler(int)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x1a388b6)
#2 0x00007fe0db5af390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#3 0x00007fe0da0f3428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#4 0x00007fe0da0f502a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#5 0x00007fe0da0ebbd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#6 0x00007fe0da0ebc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#7 0x0000000002dd292f clang::Sema::InstantiateClass(clang::SourceLocation,
clang::CXXRecordDecl*, clang::CXXRecordDecl*,
clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind, bool)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x2dd292f)
#8 0x0000000002dd3e13
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x2dd3e13)
#9 0x0000000002e3c2b2
clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType,
clang::Sema::TypeDiagnoser*) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x2e3c2b2)
#10 0x0000000002cc7cd9
clang::Sema::AddMemberOperatorCandidates(clang::OverloadedOperatorKind,
clang::SourceLocation, llvm::ArrayRef<clang::Expr*>,
clang::OverloadCandidateSet&, clang::SourceRange)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x2cc7cd9)
#11 0x0000000002cdb48d
clang::Sema::CreateOverloadedArraySubscriptExpr(clang::SourceLocation,
clang::SourceLocation, clang::Expr*, clang::Expr*)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x2cdb48d)
#12 0x0000000002b940af (anonymous
namespace)::TransformTypos::TryTransform(clang::Expr*)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x2b940af)
#13 0x0000000002b75d93 clang::Sema::CorrectDelayedTyposInExpr(clang::Expr*,
clang::VarDecl*, llvm::function_ref<clang::ActionResult<clang::Expr*, true>
(clang::Expr*)>) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x2b75d93)
#14 0x0000000002b90523 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool, bool)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x2b90523)
#15 0x0000000002d0a325 clang::Sema::BuildReturnStmt(clang::SourceLocation,
clang::Expr*) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x2d0a325)
#16 0x0000000002d097d5 clang::Sema::ActOnReturnStmt(clang::SourceLocation,
clang::Expr*, clang::Scope*) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x2d097d5)
#17 0x0000000002751479 clang::Parser::ParseReturnStatement()
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x2751479)
#18 0x000000000274c44a
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x274c44a)
#19 0x000000000274bb10
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x274bb10)
#20 0x0000000002752daa clang::Parser::ParseCompoundStatementBody(bool)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x2752daa)
#21 0x0000000002753773 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x2753773)
#22 0x00000000026cb727
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x26cb727)
#23 0x00000000026e22a1 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x26e22a1)
#24 0x00000000026caab1
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x26caab1)
#25 0x00000000026ca431
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x26ca431)
#26 0x00000000026c9495
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x26c9495)
#27 0x00000000026c85c7
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x26c85c7)
#28 0x00000000026c3c36 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x26c3c36)
#29 0x0000000001f41fe8 clang::FrontendAction::Execute()
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x1f41fe8)
#30 0x0000000001f0b651
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x1f0b651)
#31 0x0000000001fc5ec5
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/llvm-4.0.1/bin/clang-4.0+0x1fc5ec5)
#32 0x000000000081055f cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/llvm-4.0.1/bin/clang-4.0+0x81055f)
#33 0x000000000080f127 main (/usr/local/llvm-4.0.1/bin/clang-4.0+0x80f127)
#34 0x00007fe0da0de830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#35 0x000000000080c339 _start (/usr/local/llvm-4.0.1/bin/clang-4.0+0x80c339)
Stack dump:
0.      Program arguments: /usr/local/llvm-4.0.1/bin/clang-4.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
line-thickness.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb
-coverage-notes-file
/mnt/raid/projects/shelf/c++/simulated-annealing/build/CMakeFiles/sa-app.dir/source/line-thickness.cpp.gcno
-resource-dir /usr/local/llvm-4.0.1/bin/../lib/clang/4.0.1 -isystem
/usr/local/qt-5/5.7/gcc_64/include -isystem
/usr/local/qt-5/5.7/gcc_64/include/QtWidgets -isystem
/usr/local/qt-5/5.7/gcc_64/include/QtGui -isystem
/usr/local/qt-5/5.7/gcc_64/include/QtCore -isystem
/usr/local/qt-5/5.7/gcc_64/./mkspecs/linux-g++ -D QT_CORE_LIB -D QT_GUI_LIB -D
QT_WIDGETS_LIB -I /mnt/raid/projects/shelf/c++/simulated-annealing/build -I
/mnt/raid/projects/shelf/c++/simulated-annealing -I
/mnt/raid/projects/shelf/c++/simulated-annealing/build/sa-app_autogen/include
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/llvm-4.0.1/bin/../lib/clang/4.0.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -Wextra -pedantic -std=gnu++1z
-fdeprecated-macro -fdebug-compilation-dir
/mnt/raid/projects/shelf/c++/simulated-annealing/build -ferror-limit 19
-fmessage-length 80 -pthread -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -o CMakeFiles/sa-app.dir/source/line-thickness.cpp.o
-x c++
/mnt/raid/projects/shelf/c++/simulated-annealing/source/line-thickness.cpp 
1.     
/mnt/raid/projects/shelf/c++/simulated-annealing/source/line-thickness.cpp:14:31:
current parser token ';'
2.     
/mnt/raid/projects/shelf/c++/simulated-annealing/source/line-thickness.cpp:12:22:
parsing function body 'thickness'
3.     
/mnt/raid/projects/shelf/c++/simulated-annealing/source/line-thickness.cpp:12:22:
in compound statement ('{}')
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.1 (tags/RELEASE_401/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/llvm/bin
clang-4.0: 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-4.0: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/line-thickness-bbac64.cpp
clang-4.0: note: diagnostic msg: /tmp/line-thickness-bbac64.sh
clang-4.0: note: diagnostic msg: 

********************
CMakeFiles/sa-app.dir/build.make:89: recipe for target
'CMakeFiles/sa-app.dir/source/line-thickness.cpp.o' failed
make[2]: *** [CMakeFiles/sa-app.dir/source/line-thickness.cpp.o] Error 254
make[2]: Leaving directory
'/mnt/raid/projects/shelf/c++/simulated-annealing/build'
CMakeFiles/Makefile2:108: recipe for target 'CMakeFiles/sa-app.dir/all' failed
make[1]: *** [CMakeFiles/sa-app.dir/all] Error 2
make[1]: Leaving directory
'/mnt/raid/projects/shelf/c++/simulated-annealing/build'
Makefile:97: recipe for target 'all' failed
make: *** [all] Error 2

Compilation exited abnormally with code 2 at Mon Jul 10 02:53:56

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170710/b621c903/attachment-0001.html>


More information about the llvm-bugs mailing list