[llvm-bugs] [Bug 43644] New: clang crashes on a trivial program with address sanitizer and coverage when using new pass manager

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 10 21:38:21 PDT 2019


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

            Bug ID: 43644
           Summary: clang crashes on a trivial program with address
                    sanitizer and coverage when using new pass manager
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: manojgupta at google.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

$ cat test.c
a() {}

$ bin/clang -Qunused-arguments -O2 -fprofile-instr-generate -fcoverage-mapping
-fsanitize=address  -fexperimental-new-pass-manager -c test.ctest.c:1:1:
warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
a() {}
^
test.c:1:6: warning: control reaches end of non-void function [-Wreturn-type]
a() {}
     ^
clang-10: llvm-project/llvm/include/llvm/Support/Casting.h:264: typename
llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
llvm::ConstantDataArray; Y = llvm::Constant; typename llvm::cast_retty<X,
Y*>::ret_type = llvm::ConstantDataArray*]: Assertion `isa<X>(Val) &&
"cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0.      Program arguments: build/bin/clang-10 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name test.c
-mrelocation-model static -mthread-model posix -mframe-pointer=none
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-fprofile-instrument=clang -fcoverage-mapping -resource-dir
build/lib/clang/10.0.0 -internal-isystem /usr/local/include -internal-isystem
build/lib/clang/10.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir build
-ferror-limit 19 -fmessage-length 0 -fsanitize=address
-fsanitize-blacklist=build/lib/clang/10.0.0/share/asan_blacklist.txt
-fsanitize-address-use-after-scope -fno-assume-sane-operator-new
-fgnuc-version=4.2.1 -fexperimental-new-pass-manager -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-faddrsig -o test.o -x c test.c 
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x0000557d6c7a060e llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm-project/llvm/lib/Support/Unix/Signals.inc:532:22
 #1 0x0000557d6c7a06a1 PrintStackTraceSignalHandler(void*)
llvm-project/llvm/lib/Support/Unix/Signals.inc:593:1
 #2 0x0000557d6c79e827 llvm::sys::RunSignalHandlers()
llvm-project/llvm/lib/Support/Signals.cpp:68:20
 #3 0x0000557d6c7a008a SignalHandler(int)
llvm-project/llvm/lib/Support/Unix/Signals.inc:384:1
 #4 0x00007f34902ac3a0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x123a0)
 #5 0x00007f348f33acfb raise (/lib/x86_64-linux-gnu/libc.so.6+0x36cfb)
 #6 0x00007f348f3258ad abort (/lib/x86_64-linux-gnu/libc.so.6+0x218ad)
 #7 0x00007f348f32577f (/lib/x86_64-linux-gnu/libc.so.6+0x2177f)
 #8 0x00007f348f333542 (/lib/x86_64-linux-gnu/libc.so.6+0x2f542)
 #9 0x0000557d6a4dc614 llvm::cast_retty<llvm::ConstantDataArray,
llvm::Constant*>::ret_type llvm::cast<llvm::ConstantDataArray,
llvm::Constant>(llvm::Constant*)
llvm-project/llvm/include/llvm/Support/Casting.h:264:3
#10 0x0000557d6ee833bc
llvm::getPGOFuncNameVarInitializer(llvm::GlobalVariable*)
llvm-project/llvm/lib/ProfileData/InstrProf.cpp:420:38
#11 0x0000557d6c2db681
llvm::InstrProfiling::getOrCreateRegionCounters(llvm::InstrProfIncrementInst*)
llvm-project/llvm/include/llvm/ProfileData/InstrProfData.inc:72:1
#12 0x0000557d6c2d9c08 llvm::InstrProfiling::run(llvm::Module&,
std::function<llvm::TargetLibraryInfo const& (llvm::Function&)>)
llvm-project/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:516:22
#13 0x0000557d6c2d9052 llvm::InstrProfiling::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
llvm-project/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:381:7
#14 0x0000557d6ca98a3c llvm::detail::PassModel<llvm::Module,
llvm::InstrProfiling, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
llvm-project/llvm/include/llvm/IR/PassManagerInternal.h:80:3
#15 0x0000557d6bf99888 llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
llvm-project/llvm/include/llvm/IR/PassManager.h:519:7
#16 0x0000557d6ca7dbcd (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1315:12
#17 0x0000557d6ca7f3da clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1534:45

-- 
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/20191011/a4f6658c/attachment.html>


More information about the llvm-bugs mailing list