[llvm-bugs] [Bug 33290] New: x86 backend crash with int128 and pointer overflow checking

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 2 15:29:50 PDT 2017


            Bug ID: 33290
           Summary: x86 backend crash with int128 and pointer overflow
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: regehr at cs.utah.edu
                CC: llvm-bugs at lists.llvm.org

Johns-MacBook-Pro-2:clang-crasher regehr$ cat small.c
int a, *b;
unsigned char c;
void e(void) {
  for (long f = 0;;) {
    __int128 d = 2 + (__int128)&a + c;
    c = d >> 64;
    b[f] = d;
Johns-MacBook-Pro-2:clang-crasher regehr$ clang -v
clang version 5.0.0 (trunk 304596)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Users/regehr/llvm-install/bin
Johns-MacBook-Pro-2:clang-crasher regehr$ clang -fsanitize=pointer-overflow -O
Cannot emit physreg copy instruction
UNREACHABLE executed at ../lib/Target/X86/X86InstrInfo.cpp:3205!
0  clang-5.0                0x000000010ff139b8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-5.0                0x000000010ff14006 SignalHandler(int) + 502
2  libsystem_platform.dylib 0x00007fff986c1b3a _sigtramp + 26
3  libsystem_platform.dylib 0x0000000100000001 _sigtramp + 1737745633
4  libsystem_c.dylib        0x00007fff98546420 abort + 129
5  clang-5.0                0x000000010feb1de0 LLVMInstallFatalErrorHandler + 0
6  clang-5.0                0x000000010f35bcea
llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc
const&, unsigned int, unsigned int, bool) const + 5818
7  clang-5.0                0x000000010f6be5ac (anonymous
namespace)::ExpandPostRA::runOnMachineFunction(llvm::MachineFunction&) + 2620
8  clang-5.0                0x000000010f77f824
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 180
9  clang-5.0                0x000000010f9ffc9d
llvm::FPPassManager::runOnFunction(llvm::Function&) + 509
10 clang-5.0                0x000000010f9fff13
llvm::FPPassManager::runOnModule(llvm::Module&) + 67
11 clang-5.0                0x000000010fa00450
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 944
12 clang-5.0                0x00000001100e0cf3
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions
const&, clang::CodeGenOptions const&, clang::TargetOptions const&,
clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*,
clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) + 13523
13 clang-5.0                0x00000001102bb882
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 898
14 clang-5.0                0x0000000110b858e2 clang::ParseAST(clang::Sema&,
bool, bool) + 466
15 clang-5.0                0x00000001104e1e2c clang::FrontendAction::Execute()
+ 76
16 clang-5.0                0x000000011049eee1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1233
17 clang-5.0                0x00000001105266f0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4208
18 clang-5.0                0x000000010f1e8ef6 cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1206
19 clang-5.0                0x000000010f1e6f8a main + 11178
20 libdyld.dylib            0x00007fff984b2235 start + 1
21 libdyld.dylib            0x0000000000000033 start + 1739906559
Stack dump:
0.      Program arguments: /Users/regehr/llvm-install/bin/clang-5.0 -cc1
-triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -disable-free -main-file-name
small.c -mrelocation-model pic -pic-level 2 -mthread-model posix
-mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu penryn
-target-linker-version 278.4 -dwarf-column-info -debugger-tuning=lldb
-resource-dir /Users/regehr/llvm-install/lib/clang/5.0.0 -O2
-fdebug-compilation-dir /Users/regehr/clang-crasher -ferror-limit 19
-fmessage-length 113 -fsanitize=pointer-overflow
-fsanitize-recover=pointer-overflow -stack-protector 1 -fblocks
-fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature
-fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-loops -vectorize-slp -o
/var/folders/rp/76sjy01s4ns_97pg4hpgly9c0000gn/T/small-477c50.o -x c small.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'small.c'.
4.      Running pass 'Post-RA pseudo instruction expansion pass' on function
clang-5.0: error: unable to execute command: Abort trap: 6
clang-5.0: error: clang frontend command failed due to signal (use -v to see
clang version 5.0.0 (trunk 304596)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Users/regehr/llvm-install/bin
clang-5.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-5.0: note: diagnostic msg: 

Preprocessed source(s) and associated run script(s) are located at:
clang-5.0: note: diagnostic msg:
clang-5.0: note: diagnostic msg:
clang-5.0: note: diagnostic msg: Crash backtrace is located in
clang-5.0: note: diagnostic msg:
clang-5.0: note: diagnostic msg: (choose the .crash file that corresponds to
your crash)
clang-5.0: 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/20170602/acf3bd1d/attachment.html>

More information about the llvm-bugs mailing list