[llvm-bugs] [Bug 39269] New: clang's assembler crashes when given invalid assembly

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 12 12:26:18 PDT 2018


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

            Bug ID: 39269
           Summary: clang's assembler crashes when given invalid assembly
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mike.benfield at gmail.com
                CC: llvm-bugs at lists.llvm.org

I'm not bothering to attach the files since I think anyone can easily reproduce
this, but if I should let me know. 


$ cat trash.s
        .intel_syntax noprefix

.text
        .globl nonsense
nonsense:
        vmovaps         ymm2, [rdi +
$ clang trash.s
Stack dump:
0.      Program arguments: /opt/local/libexec/llvm-7.0/bin/clang -cc1as -triple
x86_64-apple-macosx10.12.0 -filetype obj -main-file-name trash.s -target-cpu
penryn -fdebug-compilation-dir /Users/mike -dwarf-debug-producer clang version
7.0.0 (tags/RELEASE_700/rc2) -dwarf-version=4 -mrelocation-model pic -o
/var/folders/y3/b1583v4s5lsg2m3xl74dv9r80000gn/T/trash-17a9fa.o
/var/folders/y3/b1583v4s5lsg2m3xl74dv9r80000gn/T/trash-53a96b.s
0  libLLVM.dylib            0x00000001074e177b
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVM.dylib            0x00000001074e10a5 llvm::sys::RunSignalHandlers() +
52
2  libLLVM.dylib            0x00000001074e1b32 SignalHandler(int) + 144
3  libsystem_platform.dylib 0x00007fffad2a1b3a _sigtramp + 26
4  libLLVM.dylib            0x00000001074516b0
5  libLLVM.dylib            0x00000001074a75cd
llvm::SmallVectorBase::grow_pod(void*, unsigned long, unsigned long) + 189
6  libLLVM.dylib            0x00000001088aa807
llvm::SmallVectorTemplateBase<std::__1::pair<(anonymous
namespace)::X86AsmParser::InfixCalculatorTok, long long>,
true>::push_back(std::__1::pair<(anonymous
namespace)::X86AsmParser::InfixCalculatorTok, long long> const&) + 73
7  libLLVM.dylib            0x00000001088a9c5c (anonymous
namespace)::X86AsmParser::IntelExprStateMachine::getImm() + 424
8  libLLVM.dylib            0x00000001088a8242 (anonymous
namespace)::X86AsmParser::ParseOperand() + 7330
9  libLLVM.dylib            0x00000001088a1a03 (anonymous
namespace)::X86AsmParser::ParseInstruction(llvm::ParseInstructionInfo&,
llvm::StringRef, llvm::SMLoc,
llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand,
std::__1::default_delete<llvm::MCParsedAsmOperand> > >&) + 4863
10 libLLVM.dylib            0x0000000107e6f981 (anonymous
namespace)::AsmParser::parseStatement((anonymous
namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) + 4443
11 libLLVM.dylib            0x0000000107e6b866 (anonymous
namespace)::AsmParser::Run(bool, bool) + 360
12 clang                    0x0000000105d82e0c cc1as_main(llvm::ArrayRef<char
const*>, char const*, void*) + 9876
13 clang                    0x0000000105d7e917 main + 8020
14 libdyld.dylib            0x00007fffad092235 start + 1
15 libdyld.dylib            0x0000000000000014 start + 1391910368
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang integrated assembler command failed due to signal (use -v
to see invocation)
clang version 7.0.0 (tags/RELEASE_700/rc2)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-7.0/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.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:
/var/folders/y3/b1583v4s5lsg2m3xl74dv9r80000gn/T/trash-7ac3c1.S
clang: note: diagnostic msg:
/var/folders/y3/b1583v4s5lsg2m3xl74dv9r80000gn/T/trash-7ac3c1.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg:
/Users/mike/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your
crash)
clang: note: diagnostic msg:

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

-- 
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/20181012/996518fc/attachment.html>


More information about the llvm-bugs mailing list