[llvm-bugs] [Bug 27650] New: Segfault for inline assembly

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 4 15:24:59 PDT 2016


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

            Bug ID: 27650
           Summary: Segfault for inline assembly
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cturt at hardenedbsd.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

On clang 3.4, attempting to compile the following 2 lines will result in a
segfault:

asm("test:
ret");

The output is as follows:

/var/www/html $ clang cl.c -o cl
cl.c:1:5: warning: missing terminating '"' character [-Winvalid-pp-token]
asm("test:
    ^
cl.c:1:5: error: expected string literal in 'asm'
cl.c:2:4: warning: missing terminating '"' character [-Winvalid-pp-token]
ret");
   ^
0  libLLVM-3.4.so.1 0x00007f78394345d2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.4.so.1 0x00007f78394343c4
2  libpthread.so.0  0x00007f7838339340
3  clang            0x000000000118d15f clang::Lexer::Lex(clang::Token&) + 31
4  clang            0x00000000011cf3af clang::Preprocessor::Lex(clang::Token&)
+ 159
5  clang            0x000000000092a5c3
clang::Parser::ParseSimpleAsm(clang::SourceLocation*) + 835
6  clang            0x000000000092b054
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 484
7  clang            0x000000000092b5f6
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 182
8  clang            0x00000000009227b0 clang::ParseAST(clang::Sema&, bool,
bool) + 352
9  clang            0x0000000000671149 clang::FrontendAction::Execute() + 169
10 clang            0x0000000000651a75
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 293
11 clang            0x000000000063c9b6
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1638
12 clang            0x0000000000638788 cc1_main(char const**, char const**,
char const*, void*) + 1176
13 clang            0x0000000000636fff main + 7519
14 libc.so.6        0x00007f7837a6bec5 __libc_start_main + 245
15 clang            0x00000000006377ef
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name cl.c
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.24 -resource-dir /usr/bin/../lib/clang/3.4
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.4/include -internal-externc-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdebug-compilation-dir /var/www/html
-ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
/tmp/cl-9661f2.o -x c cl.c 
1.    <unknown> parser at unknown location
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://bugs.debian.org/ 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/cl-212f61.c
clang: note: diagnostic msg: /tmp/cl-212f61.sh
clang: note: diagnostic msg: 

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

/temp/cl-212f61.sh contains:

 "/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name cl.c -mrelocation-model
static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.24
-ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -x c cl-212f61.c

-- 
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/20160504/8ccb883e/attachment-0001.html>


More information about the llvm-bugs mailing list