[llvm-bugs] [Bug 28196] New: crash at -O1 and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = llvm::GlobalValue; From = llvm::Value]: Assertion `Val && "isa<> used on a null pointer"' failed.)

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 19 17:46:37 PDT 2016


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

            Bug ID: 28196
           Summary: crash at -O1 and above in both 32-bit and 64-bit modes
                    on x86_64-linux-gnu (static bool llvm::isa_impl_cl<To,
                    const From*>::doit(const From*) [with To =
                    llvm::GlobalValue; From = llvm::Value]: Assertion `Val
                    && "isa<> used on a null pointer"' failed.)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: chengniansun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This is a recent regression, as clang-3.8 does not crash.

$: clang-trunk -v
clang version 3.9.0 (trunk 272938) (llvm/trunk 272936)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$: 
$: clang-trunk -O1 small.c
clang-3.9:
/tmp/llvm-builder/llvm-source-trunk/include/llvm/Support/Casting.h:95: static
bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
llvm::GlobalValue; From = llvm::Value]: Assertion `Val && "isa<> used on a null
pointer"' failed.
#0 0x0000000001c6b8b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1c6b8b5)
#1 0x0000000001c69776 llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-3.9+0x1c69776)
#2 0x0000000001c69994 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-3.9+0x1c69994)
#3 0x00007f4be853c8d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x00007f4be777a067 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35067)
#5 0x00007f4be777b448 abort (/lib/x86_64-linux-gnu/libc.so.6+0x36448)
#6 0x00007f4be7773266 (/lib/x86_64-linux-gnu/libc.so.6+0x2e266)
#7 0x00007f4be7773312 (/lib/x86_64-linux-gnu/libc.so.6+0x2e312)
#8 0x00000000007f8708 llvm::isa_impl_cl<llvm::Instruction, llvm::Value
const*>::doit(llvm::Value const*) [clone .part.140]
(/usr/local/clang-trunk/bin/clang-3.9+0x7f8708)
#9 0x0000000001940617 (/usr/local/clang-trunk/bin/clang-3.9+0x1940617)
#10 0x0000000001cb103c
llvm::RecursivelyDeleteTriviallyDeadInstructions(llvm::Value*,
llvm::TargetLibraryInfo const*)
(/usr/local/clang-trunk/bin/clang-3.9+0x1cb103c)
#11 0x0000000001b485bf deleteDeadInstruction(llvm::Instruction*,
llvm::TargetLibraryInfo const*)
(/usr/local/clang-trunk/bin/clang-3.9+0x1b485bf)
#12 0x0000000001b499db (anonymous
namespace)::LoopIdiomRecognize::processLoopStoreOfLoopLoad(llvm::StoreInst*,
llvm::SCEV const*) (/usr/local/clang-trunk/bin/clang-3.9+0x1b499db)
#13 0x0000000001b4dcc1 (anonymous
namespace)::LoopIdiomRecognize::runOnLoop(llvm::Loop*, llvm::LPPassManager&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1b4dcc1)
#14 0x000000000248ac1b llvm::LPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-3.9+0x248ac1b)
#15 0x0000000001910b03 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1910b03)
#16 0x000000000246b297 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-3.9+0x246b297)
#17 0x0000000001911248 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1911248)
#18 0x0000000001da0b11 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) (/usr/local/clang-trunk/bin/clang-3.9+0x1da0b11)
#19 0x000000000236ac6d
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-3.9+0x236ac6d)
#20 0x000000000269c34d clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x269c34d)
#21 0x000000000236afbb clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-3.9+0x236afbb)
#22 0x000000000209aa4e clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-3.9+0x209aa4e)
#23 0x0000000002071526
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-3.9+0x2071526)
#24 0x0000000002123942
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2123942)
#25 0x0000000000b0eba8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-3.9+0xb0eba8)
#26 0x0000000000ac3325 main (/usr/local/clang-trunk/bin/clang-3.9+0xac3325)
#27 0x00007f4be7766b45 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b45)
#28 0x0000000000b0ad04 _start (/usr/local/clang-trunk/bin/clang-3.9+0xb0ad04)
Stack dump:
0.      Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.0 -c-isystem . -c-isystem
/usr/local/include/csmith -c-isystem /usr/local/include/csmith
-internal-isystem /usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/3.9.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O1 -fdebug-compilation-dir
/home/cnsun/workspace/meta-compiler/error-fuzzer/temp-runs/IdentifierSubstituionFuzzingEngine/crash/20160619-clang-trunk--O3-c-Weverything-std=c11-build-110303
-ferror-limit 19 -fmessage-length 270 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/small-4659fa.o -x c
small.c 
1.      <eof> parser at end of file
2.      Per-module optimization passes
#2 0x0000000001c69994 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-3.9+0x1c69994)
#3 0x00007f4be853c8d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x00007f4be777a067 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35067)
#5 0x00007f4be777b448 abort (/lib/x86_64-linux-gnu/libc.so.6+0x36448)
#6 0x00007f4be7773266 (/lib/x86_64-linux-gnu/libc.so.6+0x2e266)
#7 0x00007f4be7773312 (/lib/x86_64-linux-gnu/libc.so.6+0x2e312)
#8 0x00000000007f8708 llvm::isa_impl_cl<llvm::Instruction, llvm::Value
const*>::doit(llvm::Value const*) [clone .part.140]
(/usr/local/clang-trunk/bin/clang-3.9+0x7f8708)
#9 0x0000000001940617 (/usr/local/clang-trunk/bin/clang-3.9+0x1940617)
#10 0x0000000001cb103c
llvm::RecursivelyDeleteTriviallyDeadInstructions(llvm::Value*,
llvm::TargetLibraryInfo const*)
(/usr/local/clang-trunk/bin/clang-3.9+0x1cb103c)
#11 0x0000000001b485bf deleteDeadInstruction(llvm::Instruction*,
llvm::TargetLibraryInfo const*)
(/usr/local/clang-trunk/bin/clang-3.9+0x1b485bf)
#12 0x0000000001b499db (anonymous
namespace)::LoopIdiomRecognize::processLoopStoreOfLoopLoad(llvm::StoreInst*,
llvm::SCEV const*) (/usr/local/clang-trunk/bin/clang-3.9+0x1b499db)
#13 0x0000000001b4dcc1 (anonymous
namespace)::LoopIdiomRecognize::runOnLoop(llvm::Loop*, llvm::LPPassManager&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1b4dcc1)
#14 0x000000000248ac1b llvm::LPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-3.9+0x248ac1b)
#15 0x0000000001910b03 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1910b03)
#16 0x000000000246b297 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-3.9+0x246b297)
#17 0x0000000001911248 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1911248)
#18 0x0000000001da0b11 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) (/usr/local/clang-trunk/bin/clang-3.9+0x1da0b11)
#19 0x000000000236ac6d
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-3.9+0x236ac6d)
#20 0x000000000269c34d clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x269c34d)
#21 0x000000000236afbb clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-3.9+0x236afbb)
#22 0x000000000209aa4e clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-3.9+0x209aa4e)
#23 0x0000000002071526
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-3.9+0x2071526)
#24 0x0000000002123942
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2123942)
#25 0x0000000000b0eba8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-3.9+0xb0eba8)
#26 0x0000000000ac3325 main (/usr/local/clang-trunk/bin/clang-3.9+0xac3325)
#27 0x00007f4be7766b45 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b45)
#28 0x0000000000b0ad04 _start (/usr/local/clang-trunk/bin/clang-3.9+0xb0ad04)
Stack dump:
0.      Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.c
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/3.9.0 -c-isystem . -c-isystem
/usr/local/include/csmith -c-isystem /usr/local/include/csmith
-internal-isystem /usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/3.9.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O1 -fdebug-compilation-dir
/home/cnsun/workspace/meta-compiler/error-fuzzer/temp-runs/IdentifierSubstituionFuzzingEngine/crash/20160619-clang-trunk--O3-c-Weverything-std=c11-build-110303
-ferror-limit 19 -fmessage-length 270 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/small-4659fa.o -x c
small.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'small.c'.
4.      Running pass 'Loop Pass Manager' on function '@main'
5.      Running pass 'Recognize loop idioms' on basic block '%for.body'
clang-3.9: error: unable to execute command: Aborted
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 272938) (llvm/trunk 272936)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-3.9: 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-3.9: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/small-bb4ddf.c
clang-3.9: note: diagnostic msg: /tmp/small-bb4ddf.sh
clang-3.9: note: diagnostic msg:

********************
$:  cat small.c
int a;
int main() {
  int j = 0;
  for (;;)
    for (; j < 6; j++)
      *((int *)0 + a + j) = *((int *)0 + a + j + 1);
  return 0;
}

$:

-- 
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/20160620/8701727e/attachment-0001.html>


More information about the llvm-bugs mailing list