Skip to content

[clang] unable to rename temporary "xxx.o.tmp" to "xxx.o" (random occur) #144457

Open
@luoliwoshang

Description

@luoliwoshang

clang

/usr/lib/llvm-19/bin/clang
Ubuntu clang version 19.1.7 (++20250114[10](https://github.com/goplus/llgo/actions/runs/15680235263/job/44169711114?pr=1157#step:4:11)3332+cd708029e0b2-1~exp1~20250114103446.78)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin

env

Linux fv-az2210-267 6.11.0-1015-azure #15~24.04.1-Ubuntu SMP Thu May  1 02:52:08 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.2 LTS
Release:	24.04
Codename:	noble

origin ci link https://github.com/goplus/llgo/actions/runs/15673758597/job/44149438177?pr=1157 , and follow is ci's fail stack dump

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /usr/lib/llvm-19/bin/clang -cc1 -triple x86_64-unknown-linux -emit-obj -dumpdir /tmp/llgo-2668141638- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name 2ec0f766d579ebb30f68bbe64d66b741397f422757a0974421b83cc25ad22ca1-d.ll -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/runner/work/llgo/llgo/internal/build -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/home/runner/work/llgo/llgo/internal/build -resource-dir /usr/lib/llvm-19/lib/clang/19 -Wno-override-module -Wno-override-module -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/2ec0f766d579ebb30f68bbe64d66b741397f422757a0974421b83cc25ad22ca1-d-d12ee2.o -x ir /home/runner/.cache/go-build/2e/2ec0f766d579ebb30f68bbe64d66b741397f422757a0974421b83cc25ad22ca1-d.ll
 #0 0x00007fa203abd42f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0xebd42f)
 #1 0x00007fa203abb139 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0xebb139)
 #2 0x00007fa203abdb80 (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0xebdb80)
 #3 0x00007fa202445330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007fa206cebe0d llvm::LLLexer::LexToken() (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x40ebe0d)
 #5 0x00007fa206d1f65e llvm::LLParser::parseGetElementPtr(llvm::Instruction*&, llvm::LLParser::PerFunctionState&) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x411f65e)
 #6 0x00007fa206d1[70](https://github.com/goplus/llgo/actions/runs/15673758597/job/44149438177?pr=1157#step:7:71)b2 llvm::LLParser::parseBasicBlock(llvm::LLParser::PerFunctionState&) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x41170b2)
 #7 0x00007fa206cf9e70 llvm::LLParser::parseFunctionBody(llvm::Function&, unsigned int, llvm::ArrayRef<unsigned int>) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x40f9e70)
 #8 0x00007fa206cf6236 llvm::LLParser::parseDefine() (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x40f6236)
 #9 0x00007fa206cf3207 llvm::LLParser::parseTopLevelEntities() (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x40f3207)
#10 0x00007fa206cf2dcd llvm::LLParser::Run(bool, llvm::function_ref<std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> (llvm::StringRef, llvm::StringRef)>) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x40f2dcd)
#11 0x00007fa206d3551b (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x413551b)
#12 0x00007fa206d356cc llvm::parseAssembly(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::SlotMapping*, llvm::function_ref<std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> (llvm::StringRef, llvm::StringRef)>) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x41356cc)
#13 0x00007fa203ceec64 llvm::parseIR(llvm::MemoryBufferRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::ParserCallbacks) (/usr/lib/llvm-19/bin/../lib/libLLVM.so.19.1+0x10eec64)
#14 0x00007fa20ca66e30 clang::CodeGenAction::loadModule(llvm::MemoryBufferRef) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.1+0x2266e30)
#15 0x00007fa20ca67956 clang::CodeGenAction::ExecuteAction() (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.1+0x2267956)
#16 0x00007fa20d57b67c clang::FrontendAction::Execute() (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.1+0x2d7b67c)
#17 0x00007fa20d4ee9f4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.1+0x2cee9f4)
#18 0x00007fa20d5fad2c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-19/bin/../lib/libclang-cpp.so.19.1+0x2dfad2c)
#19 0x000055ac95cb21d2 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-19/bin/clang+0x131d2)
#20 0x000055ac95caf1a4 (/usr/lib/llvm-19/bin/clang+0x101a4)
#21 0x000055ac95cae342 clang_main(int, char**, llvm::ToolContext const&) (/usr/lib/llvm-19/bin/clang+0xf342)
#22 0x000055ac95cbc703 main (/usr/lib/llvm-19/bin/clang+0x1d703)
#23 0x00007fa20242a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#24 0x00007fa20242a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#25 0x000055ac95cacda5 _start (/usr/lib/llvm-19/bin/clang+0xdda5)
error: unable to rename temporary '/tmp/2ec0f766d579ebb30f68bbe64d66b[74](https://github.com/goplus/llgo/actions/runs/15673758597/job/44149438177?pr=1157#step:7:75)1397f422757a0974421b83cc25ad22ca1-d-d12ee2-daca2e82.o.tmp' to output file '/tmp/2ec0f766d579ebb30f68bbe64d66b741397f422[75](https://github.com/goplus/llgo/actions/runs/15673758597/job/44149438177?pr=1157#step:7:76)7a0974421b83cc25ad22ca1-d-d12ee2.o': 'No such file or directory'

correspoding ir

2ec0f766d579ebb30f68bbe64d66b741397f422757a0974421b83cc25ad22ca1-d.ll

but in my local env , i try to compile this ir,havent got same error and works normally.

root@cppkg-5-77b864d675-2x9cg:~/llgo# clang -cc1 -triple x86_64-unknown-linux -emit-obj -dumpdir /tmp/llgo-2668141638- -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name 2ec0f766d579ebb30f68bbe64d66b741397f422757a0974421b83cc25ad22ca1-d.ll -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/runner/work/llgo/llgo/internal/build -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/root/llgo/internal/build -resource-dir /usr/lib/llvm-19/lib/clang/19 -Wno-override-module -Wno-override-module -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o ./test.o -x ir ./3d7b27d9195e7b73e089feac27550fd49d7309b9f5695bc7d06db82532eb5ce7-d.ll

and the test.o have symbols

root@cppkg-5-77b864d675-2x9cg:~/llgo# llvm-nm ./test.o
0000000000000000 V *_llgo_unicode.RangeTable
0000000000000078 r .L__unnamed_100
0000000000000080 r .L__unnamed_110
0000000000000088 r .L__unnamed_111
0000000000000010 r .L__unnamed_112
0000000000000090 r .L__unnamed_115
.......
0000000000000000 V map[_llgo_string]*_llgo_unicode.RangeTable
0000000000000000 T unicode.(*SpecialCase).ToLower
0000000000000000 T unicode.(*SpecialCase).ToTitle
0000000000000000 T unicode.(*SpecialCase).ToUpper
0000000000000000 B unicode.ASCII_Hex_Digit
0000000000000000 B unicode.Adlam

reproduce

  1. with the docker file https://github.com/luoliwoshang/DockerFiles/blob/v0.2.0/ubuntu/normal/Dockerfile
  2. cd /root/llgo
  3. count=1; while go test -count=1 ./...; do echo "=== Run #$((count++)) completed ==="; done

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions