[LLVMbugs] [Bug 13652] New: Segmentation fault with syntactically invalid C++11 lambda
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Aug 20 14:12:19 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=13652
Bug #: 13652
Summary: Segmentation fault with syntactically invalid C++11
lambda
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: jmg116 at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
The following snippet segfaults clang 3.2 (clang commit
94572c32af458c97f6f5a9fafea44e84baa656bf, llvm
62a89f5808bbb620767d95adb784978ed2e7bff0) on OS X 10.8.0.
int main (int argc, char *argv[])
{
auto foo = [](int) -> {};
}
It does not segfault with Apple's clang version 4.0
(tags/Apple/clang-421.10.53) (based on LLVM 3.1svn), and the following snippet
doesn't segfault either:
int main (int argc, char *argv[])
{
auto foo = [](void) -> {};
}
reaver:~ josh$ clang++ -std=c++11 test.cpp
test.cpp:3:27: error: expected a type
auto foo = [](int) -> {};
^
0 clang 0x0000000107d07492
llvm::SmallVectorImpl<char>::swap(llvm::SmallVectorImpl<char>&) + 10536
1 clang 0x0000000107d07a69
llvm::SmallVectorImpl<char>::swap(llvm::SmallVectorImpl<char>&) + 12031
2 libsystem_c.dylib 0x00007fff8a6a592a _sigtramp + 26
3 clang 0x0000000107184487 std::_Rb_tree<clang::edit::FileOffset,
std::pair<clang::edit::FileOffset const, clang::edit::EditedSource::FileEdit>,
std::_Select1st<std::pair<clang::edit::FileOffset const,
clang::edit::EditedSource::FileEdit> >, std::less<clang::edit::FileOffset>,
std::allocator<std::pair<clang::edit::FileOffset const,
clang::edit::EditedSource::FileEdit> >
>::_M_insert_unique(std::_Rb_tree_iterator<std::pair<clang::edit::FileOffset
const, clang::edit::EditedSource::FileEdit> >,
std::pair<clang::edit::FileOffset const, clang::edit::EditedSource::FileEdit>
const&) + 80761
4 clang 0x0000000106ccd280
llvm::SmallVectorTemplateBase<clang::OpaqueValueExpr, false>::grow(unsigned
long) + 190264
5 clang 0x0000000106ccd8e9
llvm::SmallVectorTemplateBase<clang::OpaqueValueExpr, false>::grow(unsigned
long) + 191905
6 clang 0x0000000106ae8013
llvm::SmallVectorTemplateBase<clang::Sema::OffsetOfComponent,
false>::grow(unsigned long) + 31859
7 clang 0x0000000106ae88b0
llvm::SmallVectorTemplateBase<clang::Sema::OffsetOfComponent,
false>::grow(unsigned long) + 34064
8 clang 0x0000000106ade2ca
llvm::SmallVectorImpl<clang::sema::DelayedDiagnostic>::operator=(llvm::SmallVectorImpl<clang::sema::DelayedDiagnostic>
const&) + 26618
9 clang 0x0000000106ad8d3d
llvm::SmallVectorImpl<clang::sema::DelayedDiagnostic>::operator=(llvm::SmallVectorImpl<clang::sema::DelayedDiagnostic>
const&) + 4717
10 clang 0x0000000106ad8d0a
llvm::SmallVectorImpl<clang::sema::DelayedDiagnostic>::operator=(llvm::SmallVectorImpl<clang::sema::DelayedDiagnostic>
const&) + 4666
11 clang 0x0000000106ab974e std::vector<std::pair<llvm::WeakVH,
llvm::Constant*>, std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> >
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::WeakVH,
llvm::Constant*>*, std::vector<std::pair<llvm::WeakVH, llvm::Constant*>,
std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> > > >,
std::pair<llvm::WeakVH, llvm::Constant*> const&) + 70628
12 clang 0x0000000106ac12e0 std::vector<std::pair<llvm::WeakVH,
llvm::Constant*>, std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> >
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::WeakVH,
llvm::Constant*>*, std::vector<std::pair<llvm::WeakVH, llvm::Constant*>,
std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> > > >,
std::pair<llvm::WeakVH, llvm::Constant*> const&) + 102262
13 clang 0x0000000106aca09b std::vector<std::pair<llvm::WeakVH,
llvm::Constant*>, std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> >
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::WeakVH,
llvm::Constant*>*, std::vector<std::pair<llvm::WeakVH, llvm::Constant*>,
std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> > > >,
std::pair<llvm::WeakVH, llvm::Constant*> const&) + 138545
14 clang 0x0000000106aca240 std::vector<std::pair<llvm::WeakVH,
llvm::Constant*>, std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> >
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::WeakVH,
llvm::Constant*>*, std::vector<std::pair<llvm::WeakVH, llvm::Constant*>,
std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> > > >,
std::pair<llvm::WeakVH, llvm::Constant*> const&) + 138966
15 clang 0x0000000106afc785
llvm::SmallVectorTemplateBase<clang::Sema::ObjCArgInfo, false>::grow(unsigned
long) + 18597
16 clang 0x0000000106af9e80
llvm::SmallVectorTemplateBase<clang::Sema::ObjCArgInfo, false>::grow(unsigned
long) + 8096
17 clang 0x0000000106b00642
llvm::SmallVectorTemplateBase<clang::Sema::ObjCArgInfo, false>::grow(unsigned
long) + 34658
18 clang 0x0000000106b00ee5
llvm::SmallVectorTemplateBase<clang::Sema::ObjCArgInfo, false>::grow(unsigned
long) + 36869
19 clang 0x0000000106b0f9ec
llvm::SmallVectorTemplateBase<clang::ParsedTemplateArgument,
false>::grow(unsigned long) + 34956
20 clang 0x0000000106ac15a1 std::vector<std::pair<llvm::WeakVH,
llvm::Constant*>, std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> >
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::WeakVH,
llvm::Constant*>*, std::vector<std::pair<llvm::WeakVH, llvm::Constant*>,
std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> > > >,
std::pair<llvm::WeakVH, llvm::Constant*> const&) + 102967
21 clang 0x0000000106b0c2d7
llvm::SmallVectorTemplateBase<clang::ParsedTemplateArgument,
false>::grow(unsigned long) + 20855
22 clang 0x0000000106b0c5ff
llvm::SmallVectorTemplateBase<clang::ParsedTemplateArgument,
false>::grow(unsigned long) + 21663
23 clang 0x0000000106b0cf44
llvm::SmallVectorTemplateBase<clang::ParsedTemplateArgument,
false>::grow(unsigned long) + 24036
24 clang 0x0000000106b0d402
llvm::SmallVectorTemplateBase<clang::ParsedTemplateArgument,
false>::grow(unsigned long) + 25250
25 clang 0x0000000106ab3cbb std::vector<std::pair<llvm::WeakVH,
llvm::Constant*>, std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> >
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::pair<llvm::WeakVH,
llvm::Constant*>*, std::vector<std::pair<llvm::WeakVH, llvm::Constant*>,
std::allocator<std::pair<llvm::WeakVH, llvm::Constant*> > > >,
std::pair<llvm::WeakVH, llvm::Constant*> const&) + 47441
26 clang 0x0000000106a7a15e std::vector<clang::CXXRecordDecl
const*, std::allocator<clang::CXXRecordDecl const*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<clang::CXXRecordDecl const**,
std::vector<clang::CXXRecordDecl const*, std::allocator<clang::CXXRecordDecl
const*> > >, clang::CXXRecordDecl const* const&) + 2450
27 clang 0x00000001068b65c6
llvm::SmallVectorTemplateBase<clang::CharSourceRange, false>::grow(unsigned
long) + 2818
28 clang 0x0000000106892ef3 std::vector<clang::CompilerInstance*,
std::allocator<clang::CompilerInstance*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<clang::CompilerInstance**,
std::vector<clang::CompilerInstance*, std::allocator<clang::CompilerInstance*>
> >, clang::CompilerInstance* const&) + 7105
29 clang 0x000000010687d5c6 llvm::InitializeAllTargets() + 21894
30 clang 0x00000001068770ac
31 clang 0x000000010687a815 llvm::InitializeAllTargets() + 10197
32 libdyld.dylib 0x00007fff87f907e1 start + 0
Stack dump:
0. Program arguments:
/Users/josh/Push/toolchain/x86_64-apple-macosx10.8.0/usr/bin/clang -cc1 -triple
x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name test.cpp -pic-level 2 -mdisable-fp-elim
-masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 134.3
-resource-dir
/Users/josh/Push/toolchain/x86_64-apple-macosx10.8.0/usr/bin/../lib/clang/3.2
-fmodule-cache-path
/var/folders/g4/nn3bmsvj74q85ql03n78xjyh0000gn/T/clang-module-cache -std=c++11
-fdeprecated-macro -fdebug-compilation-dir /Users/josh -ferror-limit 19
-fmessage-length 253 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/g4/nn3bmsvj74q85ql03n78xjyh0000gn/T/test-RGFDs0.o -x c++ test.cpp
1. test.cpp:3:27: current parser token '{'
2. test.cpp:2:1: parsing function body 'main'
3. test.cpp:2:1: in compound statement ('{}')
4. test.cpp:3:16: lambda expression parsing
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (http://llvm.org/git/clang.git
94572c32af458c97f6f5a9fafea44e84baa656bf) (http://llvm.org/git/llvm
62a89f5808bbb620767d95adb784978ed2e7bff0)
Target: x86_64-apple-darwin12.0.0
Thread model: posix
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:
/var/folders/g4/nn3bmsvj74q85ql03n78xjyh0000gn/T/test-LgQ9N5.cpp
clang: note: diagnostic msg:
/var/folders/g4/nn3bmsvj74q85ql03n78xjyh0000gn/T/test-LgQ9N5.sh
clang: note: diagnostic msg:
********************
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list