[llvm-bugs] [Bug 44248] New: Seg fault in ArgumentPromotion

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Dec 7 16:10:07 PST 2019


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

            Bug ID: 44248
           Summary: Seg fault in ArgumentPromotion
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: paulsson at linux.vnet.ibm.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 22919
  --> https://bugs.llvm.org/attachment.cgi?id=22919&action=edit
testcase

I got a test case that fails with a seg fault every now and then... :-/

It seemed that I had to play around with removing options and all of a sudden
the crash would appear again, every once in a while...

This is the full command line that triggered the (csmith) crash:
clang -O3 -march=arch13 crash1.i -o a.out -w -mllvm -disable-preinline -mllvm
-loop-predication-enable-count-down-loop=false -mllvm -expensive-combines
-mllvm -max-interleave-group-factor=0 -mllvm -phi-node-folding-threshold=4
-mllvm -jump-threading-across-loop-headers -mllvm -pre-RA-sched=list-ilp -\
mllvm -disable-dfa-sched -mllvm -disable-machine-dce -mllvm
-disable-machine-sink -mllvm -disable-early-ifcvt -mllvm
-disable-preheader-prot -mllvm -addr-sink-new-phis -mllvm -verify-misched
-mllvm -hoist-cheap-insts -mllvm -terminal-rule

I then reran and removed one argument pair at a time until I got the crash:

clang -O3 -march=arch13 crash1.i -o a.out -w -mllvm -disable-preinline -mllvm
-loop-predication-enable-count-down-loop=false -mllvm -expensive-combines
-mllvm -max-interleave-group-factor=0 -mllvm -phi-node-folding-threshold=4
-mllvm -jump-threading-across-loop-headers -mllvm -pre-RA-sched=list-ilp -\
mllvm -disable-dfa-sched -mllvm -disable-machine-dce -mllvm
-disable-machine-sink -mllvm -disable-early-ifcvt -mllvm
-disable-preheader-prot -mllvm -addr-sink-new-phis -mllvm -verify-misched
-mllvm -hoist-cheap-insts

clang -O3 -march=arch13 crash1.i -o a.out -w -mllvm -disable-preinline -mllvm
-loop-predication-enable-count-down-loop=false -mllvm -expensive-combines
-mllvm -max-interleave-group-factor=0 -mllvm -phi-node-folding-threshold=4
-mllvm -jump-threading-across-loop-headers -mllvm -pre-RA-sched=list-ilp -\
mllvm -disable-dfa-sched -mllvm -disable-machine-dce -mllvm
-disable-machine-sink -mllvm -disable-early-ifcvt -mllvm
-disable-preheader-prot -mllvm -addr-sink-new-phis -mllvm -verify-misched

...

clang -O3 -march=arch13 crash1.i -o a.out -w -mllvm -disable-preinline -mllvm
-loop-predication-enable-count-down-loop=false -mllvm -expensive-combines
-mllvm -max-interleave-group-factor=0 -mllvm -phi-node-folding-threshold=4
-mllvm -jump-threading-across-loop-headers

clang -O3 -march=arch13 crash1.i -o a.out -w -mllvm -disable-preinline -mllvm
-loop-predication-enable-count-down-loop=false -mllvm -expensive-combines
-mllvm -max-interleave-group-factor=0 -mllvm -phi-node-folding-threshold=4

Stack dump:
0.      Program arguments: clang-10 -cc1 -triple s390x-ibm-linux -emit-obj
-disable-free -main-file-name crash1.i -mrelocation-model static -mthread-model
posix -mframe-pointer=none -fmath-errno -fno-rounding-math -masm-verbose
-mconstructor-aliases -fuse-init-array -target-cpu arch13 -dwarf-column-i\
nfo -debugger-tuning=gdb -resource-dir lib/clang/10.0.0 -O3 -w
-fdebug-compilation-dir /home/ijonpan/csmith/run1 -ferror-limit 19
-fmessage-length 0 -fno-signed-char -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-mllvm -disable-p\
reinline -mllvm -loop-predication-enable-count-down-loop=false -mllvm
-expensive-combines -mllvm -max-interleave-group-factor=0 -mllvm
-phi-node-folding-threshold=4 -faddrsig -o /tmp/crash1-d335c2.o -x cpp-output
crash1.i
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'crash1.c'.
 #0 0x000002aa073b20d4 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(clang-10+0x18320d4)
 #1 0x000002aa073b000e llvm::sys::RunSignalHandlers() (clang-10+0x183000e)
 #2 0x000002aa073b01b0 SignalHandler(int) (clang-10+0x18301b0)
 #3 0x000002aa0d060c5e
 #4 0x000002aa085cfe84 llvm::CallGraphSCC::ReplaceNode(llvm::CallGraphNode*,
llvm::CallGraphNode*) (clang-10+0x2a4fe84)
 #5 0x000002aa06d93dfe (anonymous
namespace)::ArgPromotion::runOnSCC(llvm::CallGraphSCC&) (.part.0)
(clang-10+0x1213dfe)
 #6 0x000002aa085d2faa (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&) (clang-10+0x2a52faa)
 #7 0x000002aa06d01be4 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(clang-10+0x1181be4)
 #8 0x000002aa0763a094 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, st\
d
::default_delete<llvm::raw_pwrite_stream> >) (clang-10+0x1aba094)
 #9 0x000002aa0829fc98
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(clang-10+0x271fc98)
#10 0x000002aa091270b0 clang::ParseAST(clang::Sema&, bool, bool)
(clang-10+0x35a70b0)
#11 0x000002aa0829ea8e clang::CodeGenAction::ExecuteAction()
(clang-10+0x271ea8e)
#12 0x000002aa07c311d8 clang::FrontendAction::Execute() (clang-10+0x20b11d8)
#13 0x000002aa07be9874
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(clang-10+0x2069874)
#14 0x000002aa07d08a12
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (clang-10+0x2188a12)
#15 0x000002aa06423488 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (clang-10+0x8a3488)
#16 0x000002aa063c2d98 main (clang-10+0x842d98)
#17 0x000003ff8b6ab6c2 __libc_start_main
/build/glibc-8Bkpa0/glibc-2.30/csu/libc-start.c:342:3
#18 0x000002aa0641f61c _start (clang-10+0x89f61c)
#19 0x0000000000000000
clang-10: error: unable to execute command: Segmentation fault
clang-10: error: clang frontend command failed due to signal (use -v to see
invocation)


This happened a few times more as well with more arguments... I suspect there
is some kind of memory dependency lurking around somewhere...

-- 
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/20191208/13867cfe/attachment-0001.html>


More information about the llvm-bugs mailing list