Issue 84434
Summary Failed to rename temporary file .thinlto-cache/...: No such file or directory
Labels new issue
Assignees
Reporter Hello71
    ```
$ ld.lld -m elf_x86_64 --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 -z noexecstack -r -o vmlinux.o -T .tmp_initcalls.lds --whole-archive vmlinux.a --no-whole-archive --start-group  --end-group
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Running pass 'Function Pass Manager' on module 'vmlinux.a(ip6_input.o at 1037338)'.
1.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@ip6_rcv_core'
LLVM ERROR: Failed to rename temporary file .thinlto-cache/Thin-e48fd7.tmp.o to .thinlto-cache/llvmcache-B56C9B947D8F57F60021C4DFF092C702CE0673E4: No such file or directory
```

When running with `--threads=1`, the output adds:

```
 #0 0x00007f0a06693836 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2293836)
 #1 0x00007f0a06690ed2 llvm::sys::RunSignalHandlers() (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2290ed2)
 #2 0x00007f0a0669412b (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x229412b)
 #3 0x00007f0a03e885f0 (/usr/lib64/libc.so.6+0x3b5f0)
 #4 0x00007f0a06f06e7e (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2b06e7e)
 #5 0x00007f0a06fe517c (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2be517c)
 #6 0x00007f0a06fe411e llvm::ScheduleDAGSDNodes::EmitSchedule(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2be411e)
 #7 0x00007f0a070ab6a1 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2cab6a1)
 #8 0x00007f0a070aa3ff llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2caa3ff)
 #9 0x00007f0a070a72cf llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2ca72cf)
#10 0x00007f0a08f3454a (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x4b3454a)
#11 0x00007f0a06b20d25 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2720d25)
#12 0x00007f0a06825f08 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2425f08)
#13 0x00007f0a0682e0e3 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x242e0e3)
#14 0x00007f0a06826611 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2426611)
#15 0x00007f0a081a0a99 (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x3da0a99)
#16 0x00007f0a081a20e7 (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x3da20e7)
#17 0x00007f0a081a1d14 llvm::lto::thinBackend(llvm::lto::Config const&, unsigned int, std::function<llvm::Expected<std::unique_ptr<llvm::CachedFileStream, std::default_delete<llvm::CachedFileStream>>> (unsigned int, llvm::Twine const&)>, llvm::Module&, llvm::ModuleSummaryIndex const&, llvm::DenseMap<llvm::StringRef, std::unordered_set<unsigned long, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<unsigned long>>, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, std::unordered_set<unsigned long, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<unsigned long>>>> const&, llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long, void>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*>> const&, llvm::MapVector<llvm::StringRef, llvm::BitcodeModule, llvm::DenseMap<llvm::StringRef, unsigned int, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, unsigned int>>, llvm::SmallVector<std::pair<llvm::StringRef, llvm::BitcodeModule>, 0u>>*, std::vector<unsigned char, std::allocator<unsigned char>> const&) (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x3da1d14)
#18 0x00007f0a08198887 (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x3d98887)
#19 0x00007f0a08197efd (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x3d97efd)
#20 0x00007f0a0658f882 (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x218f882)
#21 0x00007f0a06632d26 (/usr/lib/llvm/18/bin/../lib64/libLLVM.so.18.1+0x2232d26)
#22 0x00007f0a03ed0e7f (/usr/lib64/libc.so.6+0x83e7f)
#23 0x00007f0a03f359a8 (/usr/lib64/libc.so.6+0xe89a8)
```

This happens fairly consistently with LLVM 18.1.0 and never happened with LLVM 17.0.6. Sometimes re-running the link command a few times fixes the issue and sometimes it doesn't. Sometimes this error is output:

```
$ ld.lld -m elf_x86_64 --thinlto-cache-dir=.thinlto-cache -mllvm -import-instr-limit=5 -z noexecstack -r -o vmlinux.o -T .tmp_initcalls.lds --whole-archive vmlinux.a --no-whole-archive --start-group  --end-group
ld.lld: error: vmlinux.a(ip6_input.o at 1037338) <inline asm>:1:25: expected absolute _expression_
        addq %r8, %gs:256(%r10,$1)
 ^
```

which I don't understand but seems worryingly like the successful runs are somehow miscompiling the output.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to