Open Quuxplusone opened 9 years ago
Attached HeapStackCheck.ll
(2098 bytes, application/octet-stream): File that causes the segfault
Attached HeapStackCheck.ll
(100394 bytes, application/octet-stream): Full test case (did not try to reduce it)
Fiora on IRC determined the probelm was the metadata definition and suggested
replacing this:
!0 = !{!"top", i8* null}
!1 = !{!"stack", !0}
!2 = !{!"heap", !0}
!3 = !{!"rx", !2}
!4 = !{!"base", !0}
!5 = !{!"other", !0}
with this
!0 = !{!"top", null}
!1 = !{!6, !6, i64 0}
!2 = !{!7, !7, i64 0}
!3 = !{!8, !8, i64 0}
!4 = !{!9, !9, i64 0}
!5 = !{!10, !10, i64 0}
!6 = !{!"stack", !0}
!7 = !{!"heap", !0}
!8 = !{!"rx", !7}
!9 = !{!"base", !0}
!10 = !{!"other", !0}
I have no idea why this works and why what I had (which worked with llvm 3.6)
doesn't.
Turns out all I need to do to prevent triggering the assert was changing:
!0 = !{!"top", i8* null}
to
!0 = !{!"top", null}
HeapStackCheck.ll
(2098 bytes, application/octet-stream)HeapStackCheck.ll
(100394 bytes, application/octet-stream)Created attachment 15040 File that causes the segfault
Attached file run with:
segfaults as follows:
$ /usr/bin/opt-3.7 rts/HeapStackCheck.ll -o /dev/null -O2 0 libLLVM-3.7.so.1 0x00007fed8d11735d llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 45 1 libLLVM-3.7.so.1 0x00007fed8d116961 2 libpthread.so.0 0x00007fed8b9d78d0 3 libLLVM-3.7.so.1 0x00007fed8d272110 llvm::MDNode::getMostGenericTBAA(llvm::MDNode, llvm::MDNode) + 352 4 libLLVM-3.7.so.1 0x00007fed8d4dc748 llvm::combineMetadata(llvm::Instruction, llvm::Instruction const, llvm::ArrayRef) + 488
5 libLLVM-3.7.so.1 0x00007fed8c7b4d2a
6 libLLVM-3.7.so.1 0x00007fed8c808762
7 libLLVM-3.7.so.1 0x00007fed8c809aa3
8 libLLVM-3.7.so.1 0x00007fed8c80a01c
9 libLLVM-3.7.so.1 0x00007fed8c402c37 llvm::FPPassManager::runOnFunction(llvm::Function&) + 471
10 libLLVM-3.7.so.1 0x00007fed8c402e8b llvm::FPPassManager::runOnModule(llvm::Module&) + 43
11 libLLVM-3.7.so.1 0x00007fed8c4028c4 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 756
12 opt-3.7 0x000000000041b643 main + 7411
13 libc.so.6 0x00007fed8a53cb45 __libc_start_main + 245
14 opt-3.7 0x000000000041b834
Stack dump:
The binary is from the
llvm-3.7
package in Debian testing.