Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

SEGV in DAGTypeLegalizer::AnalyzeNewNode #43516

Closed Quuxplusone closed 4 years ago

Quuxplusone commented 4 years ago
Bugzilla Link PR44546
Status RESOLVED DUPLICATE of bug 45049
Importance P enhancement
Reported by bjorn.a.pettersson@ericsson.com
Reported on 2020-01-14 09:02:59 -0800
Last modified on 2020-04-14 00:34:16 -0700
Version trunk
Hardware PC Windows NT
CC craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@ndave.org, llvm-dev@redking.me.uk
Fixed by commit(s) rG41f13f1f64d2074ae7512fb23656c22585e912bd
Attachments red3.ll (1124 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 23017
reduced reproducer

Got a similar crash as the below for out out-of-tree target.
After reducing the test case a bit I managed to reproduce something that seem
to crash in a similar way (at least the stack trace is the same) for an in-tree
target.

One thing to notice is that there is a
   store <4 x i32> %t8, <4 x i32>* null
in the input. But I still think it is unfortunate that we get a crash here.

My debugging session for the out-of-tree target ended up somewhere around the
ReplacedValues map. And it crashed for me if I add a Val.dump in
DAGTypeLegalizer::AnalyzeNewValue after the call to RemapValue.

Here is the stack trace:

> llc -o - red3.ll -mtriple systemz
        .text
        .file   "red3.ll"
Stack dump:
0.      Program arguments: build-all/bin/llc -o - red3.ll -mtriple systemz
1.      Running pass 'Function Pass Manager' on module 'red3.ll'.
2.      Running pass 'SystemZ DAG->DAG Pattern Instruction Selection' on
function '@foo'
 #0 0x00000000023fa194 PrintStackTraceSignalHandler(void*) (build-all/bin/llc+0x23fa194)
 #1 0x00000000023f7d5e llvm::sys::RunSignalHandlers() (build-all/bin/llc+0x23f7d5e)
 #2 0x00000000023fa59c SignalHandler(int) (build-all/bin/llc+0x23fa59c)
 #3 0x00007fda6a92d630 __restore_rt (/lib64/libpthread.so.0+0xf630)
 #4 0x00000000022bfdc6 llvm::DAGTypeLegalizer::AnalyzeNewNode(llvm::SDNode*) (build-all/bin/llc+0x22bfdc6)
 #5 0x00000000022c23ed llvm::DAGTypeLegalizer::SetSplitVector(llvm::SDValue, llvm::SDValue, llvm::SDValue) (build-all/bin/llc+0x22c23ed)
 #6 0x00000000022d8dea llvm::DAGTypeLegalizer::SplitVectorResult(llvm::SDNode*, unsigned int) (build-all/bin/llc+0x22d8dea)
 #7 0x00000000022bf203 llvm::DAGTypeLegalizer::run() (build-all/bin/llc+0x22bf203)
 #8 0x00000000022c4638 llvm::SelectionDAG::LegalizeTypes() (build-all/bin/llc+0x22c4638)
 #9 0x000000000225c238 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (build-all/bin/llc+0x225c238)
#10 0x000000000225af91
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (build-
all/bin/llc+0x225af91)
#11 0x0000000002257800
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (build-
all/bin/llc+0x2257800)
#12 0x0000000001191352 (anonymous
namespace)::SystemZDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(build-all/bin/llc+0x1191352)
#13 0x00000000019c34a9
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (build-
all/bin/llc+0x19c34a9)
#14 0x0000000001d57243 llvm::FPPassManager::runOnFunction(llvm::Function&)
(build-all/bin/llc+0x1d57243)
#15 0x0000000001d57528 llvm::FPPassManager::runOnModule(llvm::Module&) (build-
all/bin/llc+0x1d57528)
#16 0x0000000001d57b8d llvm::legacy::PassManagerImpl::run(llvm::Module&) (build-
all/bin/llc+0x1d57b8d)
#17 0x000000000079f4e5 compileModule(char**, llvm::LLVMContext&) (build-
all/bin/llc+0x79f4e5)
#18 0x000000000079cf5d main (build-all/bin/llc+0x79cf5d)
#19 0x00007fda69a24545 __libc_start_main (/lib64/libc.so.6+0x22545)
#20 0x000000000079a8cf _start (build-all/bin/llc+0x79a8cf)
Segmentation fault
Quuxplusone commented 4 years ago

Attached red3.ll (1124 bytes, text/plain): reduced reproducer

Quuxplusone commented 4 years ago
This was solved by https://reviews.llvm.org/D76994
(https://reviews.llvm.org/rG41f13f1f64d2074ae7512fb23656c22585e912bd)

_This bug has been marked as a duplicate of bug 45049_