| Issue |
176490
|
| Summary |
[LLVM] Crash in UpgradeIntrinsicFunction with invalid llvm.objectsize argument type
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
sairam2661
|
**Fuzzer Generated Test Case**
**Test Commit**
[0b2f3cfb72a76fa90f3ec2a234caabe0d0712590](https://github.com/llvm/llvm-project/commit/0b2f3cfb72a76fa90f3ec2a234caabe0d0712590)
**Description**
The IR parser crashes in `upgradeIntrinsicFunction1` when `llvm.objectsize` is called with an `i64` instead of a pointer argument.
**Steps to reproduce**
- Minimized test case, `input.ll`
```
define i1 @test() {
entry:
%0 = call i64 (...) @llvm.objectsize.i64.p0(i64 3, i1 false)
%1 = icmp ugt i64 %0, 0
ret i1 %1
}
```
**Command**
```
opt -passes=verify -S input.ll
```
**Output**
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: opt -passes=verify -S input.ll
#0 0x00007f7c6d3eb728 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMSupport.so.22.0git+0x1d3728)
#1 0x00007f7c6d3e89d5 llvm::sys::RunSignalHandlers() (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMSupport.so.22.0git+0x1d09d5)
#2 0x00007f7c6d3ec3c6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f7c77514420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f7c6d67b5e2 upgradeIntrinsicFunction1(llvm::Function*, llvm::Function*&, bool) AutoUpgrade.cpp:0:0
#5 0x00007f7c6d67ae5c llvm::UpgradeIntrinsicFunction(llvm::Function*, llvm::Function*&, bool) (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMCore.so.22.0git+0xdde5c)
#6 0x00007f7c6dd14fd5 llvm::LLParser::validateEndOfModule(bool) (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMAsmParser.so.22.0git+0x34fd5)
#7 0x00007f7c6dd13e3a llvm::LLParser::Run(bool, llvm::function_ref<std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>> (llvm::StringRef, llvm::StringRef)>) (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMAsmParser.so.22.0git+0x33e3a)
#8 0x00007f7c6dd65642 parseAssemblyInto(llvm::MemoryBufferRef, llvm::Module*, llvm::ModuleSummaryIndex*, llvm::SMDiagnostic&, llvm::SlotMapping*, bool, llvm::function_ref<std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>> (llvm::StringRef, llvm::StringRef)>, llvm::AsmParserContext*) Parser.cpp:0:0
#9 0x00007f7c6dd65802 llvm::parseAssembly(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::SlotMapping*, llvm::function_ref<std::__1::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>> (llvm::StringRef, llvm::StringRef)>, llvm::AsmParserContext*) (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMAsmParser.so.22.0git+0x85802)
#10 0x00007f7c6dd9d3b8 llvm::parseIR(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::ParserCallbacks, llvm::AsmParserContext*) (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMIRReader.so.22.0git+0x33b8)
#11 0x00007f7c6dd9dcdf llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::ParserCallbacks, llvm::AsmParserContext*) (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMIRReader.so.22.0git+0x3cdf)
#12 0x00007f7c774d936e optMain (/workdir/llvm-project/build-libcxx/bin/../lib/libLLVMOptDriver.so.22.0git+0x3636e)
#13 0x00007f7c6cee0083 __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:342:3
#14 0x00005623d93c207e _start (/workdir/llvm-project/build-libcxx/bin/opt+0x207e)
Segmentation fault (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs