[llvm-bugs] [Bug 26111] New: Segmentation fault with __attribute__((mode(QI)))

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 11 07:44:20 PST 2016


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

            Bug ID: 26111
           Summary: Segmentation fault with __attribute__((mode(QI)))
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: andrey.kuleshov at intel.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

!- clang crashes with a segfault during parsing __attribute__((mode(QI)))
applied to a function -!

=========ENVIRONMENT===================
OS (host/target): Linux
Platform: x86_64
Version: trunk

=========HOW TO REPRODUCE===============
int foo () __attribute__((mode(QI))){ //this line causes segfault
  return 0;
}

int main (){
  return 0;
}

========ERROR==========================
test_attr.c:1:27: warning: GCC does not allow 'mode' attribute in this position
on a function definition [-Wgcc-compat]
int foo () __attribute__((mode(QI))){
                          ^
test_attr.c:1:27: error: mode attribute only supported for integer and
floating-point types
#0 0x0000000002c47c38 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
PATH/llvm/lib/Support/Unix/Signals.inc:322:0
#1 0x0000000002c47fb4 PrintStackTraceSignalHandler(void*)
PATH/llvm/lib/Support/Unix/Signals.inc:380:0
#2 0x0000000002c46739 llvm::sys::RunSignalHandlers()
PATH/llvm/lib/Support/Signals.cpp:44:0
#3 0x0000000002c47750 SignalHandler(int)
PATH/llvm/lib/Support/Unix/Signals.inc:210:0
#4 0x00007f5a2bbd2130 __restore_rt (/lib64/libpthread.so.0+0xf130)
#5 0x0000000002deab56 clang::FunctionType::getReturnType() const
PATH/llvm/tools/clang/include/clang/AST/Type.h:2977:0
#6 0x0000000002deb8a2 clang::FunctionDecl::getReturnType() const
PATH/llvm/tools/clang/include/clang/AST/Decl.h:1958:0
#7 0x0000000004227f90 clang::Sema::CheckFunctionDeclaration(clang::Scope*,
clang::FunctionDecl*, clang::LookupResult&, bool)
PATH/llvm/tools/clang/lib/Sema/SemaDecl.cpp:8326:0
#8 0x00000000042264cf clang::Sema::ActOnFunctionDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&) PATH/llvm/tools/clang/lib/Sema/SemaDecl.cpp:7917:0
#9 0x000000000421ae90 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
PATH/llvm/tools/clang/lib/Sema/SemaDecl.cpp:4989:0
#10 0x0000000004232621 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
clang::Sema::SkipBodyInfo*) PATH/llvm/tools/clang/lib/Sema/SemaDecl.cpp:10685:0
#11 0x0000000003e5d3a6
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
PATH/llvm/tools/clang/lib/Parse/Parser.cpp:1076:0
#12 0x0000000003e77be3 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
PATH/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1755:0
#13 0x0000000003e5ca88
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
PATH/llvm/tools/clang/lib/Parse/Parser.cpp:928:0
#14 0x0000000003e5cb40
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
PATH/llvm/tools/clang/lib/Parse/Parser.cpp:943:0
#15 0x0000000003e5c2a8
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) PATH/llvm/tools/clang/lib/Parse/Parser.cpp:801:0
#16 0x0000000003e5b72f
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
PATH/llvm/tools/clang/lib/Parse/Parser.cpp:593:0
#17 0x0000000003e57c7f clang::ParseAST(clang::Sema&, bool, bool)
PATH/llvm/tools/clang/lib/Parse/ParseAST.cpp:151:0
#18 0x00000000032aef80 clang::ASTFrontendAction::ExecuteAction()
PATH/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:540:0
#19 0x0000000003640033 clang::CodeGenAction::ExecuteAction()
PATH/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:792:0
#20 0x00000000032aea27 clang::FrontendAction::Execute()
PATH/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:443:0
#21 0x0000000003266796
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
PATH/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:841:0
#22 0x00000000033a11c6
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
PATH/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:222:0
#23 0x00000000014c87ee cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) PATH/llvm/tools/clang/tools/driver/cc1_main.cpp:116:0
#24 0x00000000014bf0b1 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) PATH/llvm/tools/clang/tools/driver/driver.cpp:301:0
#25 0x00000000014bfa31 main PATH/llvm/tools/clang/tools/driver/driver.cpp:366:0
#26 0x00007f5a2adf3af5 __libc_start_main (/lib64/libc.so.6+0x21af5)
#27 0x00000000014bcae9 _start (PATH/deploy/linux_debug/bin/clang-3.8+0x14bcae9)
Stack dump:
0.      Program arguments: PATH/deploy/linux_debug/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
test_attr.c -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
-resource-dir PATH/deploy/linux_debug/bin/../lib/clang/3.8.0 -internal-isystem
/usr/local/include -internal-isystem
PATH/deploy/linux_debug/bin/../lib/clang/3.8.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir PATH_TEST/ -ferror-limit 19 -fmessage-length 237
-fobjc-runtime=gcc -fdiagnostics-show-option -o /tmp/test_attr-f6eefe.o -x c
test_attr.c
1.      test_attr.c:1:37: current parser token '{'
clang-3.8: error: unable to execute command: Segmentation fault
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (cfe/trunk 257331)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: PATH/deploy/linux_debug/bin

------------------------
Intel Compiler Engineer
Andrey Kuleshov

-- 
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/20160111/5f0c0100/attachment-0001.html>


More information about the llvm-bugs mailing list