Skip to content

when compiling for znver3, LLVM assertion: Value does not fit in the Fixup field #17902

Description

@andrewrk
zig test ReleaseFast native: error: Assertion failed: (Size == 0 || isIntN(Size * 8 + 1, SignedValue)) && "Value does not fit in the Fixup field", file /home/andy/dev/zig-bootstrap/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp, line 715
zig test ReleaseFast native: error: the following command exited with error code 3:
D:\a\zig\zig\build-release\stage3-release\bin\zig.exe test D:\a\zig\zig\lib\std\std.zig -OReleaseFast --cache-dir D:\a\zig\zig\zig-cache --global-cache-dir C:\Users\runneradmin\AppData\Local\zig --name test -I D:\a\zig\zig\test -L D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\lib -I D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\include --zig-lib-dir D:\a\zig\zig\lib --listen=- zig test ReleaseSafe native: error: Assertion failed: (Size == 0 || isIntN(Size * 8 + 1, SignedValue)) && "Value does not fit in the Fixup field", file /home/andy/dev/zig-bootstrap/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp, line 715
zig test ReleaseSafe native: error: the following command exited with error code 3:
D:\a\zig\zig\build-release\stage3-release\bin\zig.exe test D:\a\zig\zig\lib\std\std.zig -OReleaseSafe --cache-dir D:\a\zig\zig\zig-cache --global-cache-dir C:\Users\runneradmin\AppData\Local\zig --name test -fsingle-threaded -I D:\a\zig\zig\test -L D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\lib -I D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\include --zig-lib-dir D:\a\zig\zig\lib --listen=- zig test ReleaseFast native: error: Assertion failed: (Size == 0 || isIntN(Size * 8 + 1, SignedValue)) && "Value does not fit in the Fixup field", file /home/andy/dev/zig-bootstrap/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp, line 715
zig test ReleaseFast native: error: the following command exited with error code 3:
D:\a\zig\zig\build-release\stage3-release\bin\zig.exe test D:\a\zig\zig\lib\std\std.zig -OReleaseFast --cache-dir D:\a\zig\zig\zig-cache --global-cache-dir C:\Users\runneradmin\AppData\Local\zig --name test -fsingle-threaded -I D:\a\zig\zig\test -L D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\lib -I D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\include --zig-lib-dir D:\a\zig\zig\lib --listen=- zig test ReleaseSafe native: error: Assertion failed: (Size == 0 || isIntN(Size * 8 + 1, SignedValue)) && "Value does not fit in the Fixup field", file /home/andy/dev/zig-bootstrap/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp, line 715
zig test ReleaseSafe native: error: the following command exited with error code 3:
D:\a\zig\zig\build-release\stage3-release\bin\zig.exe test D:\a\zig\zig\lib\std\std.zig -OReleaseSafe --cache-dir D:\a\zig\zig\zig-cache --global-cache-dir C:\Users\runneradmin\AppData\Local\zig --name test -I D:\a\zig\zig\test -L D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\lib -I D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\include --zig-lib-dir D:\a\zig\zig\lib --listen=- zig test ReleaseFast native: error: Assertion failed: (Size == 0 || isIntN(Size * 8 + 1, SignedValue)) && "Value does not fit in the Fixup field", file /home/andy/dev/zig-bootstrap/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp, line 715
zig test ReleaseFast native: error: the following command exited with error code 3:
D:\a\zig\zig\build-release\stage3-release\bin\zig.exe test D:\a\zig\zig\lib\std\std.zig -lc -OReleaseFast --cache-dir D:\a\zig\zig\zig-cache --global-cache-dir C:\Users\runneradmin\AppData\Local\zig --name test -I D:\a\zig\zig\test -L D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\lib -I D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492\include --zig-lib-dir D:\a\zig\zig\lib --listen=- Build Summary: 4974/5205 steps succeeded; 219 skipped; 5 failed; 50527/53261 tests passed; 2734 skipped (disable with --summary none)
test transitive failure
+- test-std transitive failure
+- run test std-native-znver3-ReleaseFast transitive failure
| +- zig test ReleaseFast native failure
+- run test std-native-znver3-ReleaseFast-libc transitive failure
| +- zig test ReleaseFast native failure
+- run test std-native-znver3-ReleaseFast-single transitive failure
| +- zig test ReleaseFast native failure
+- run test std-native-znver3-ReleaseSafe transitive failure
| +- zig test ReleaseSafe native failure
+- run test std-native-znver3-ReleaseSafe-single transitive failure
+- zig test ReleaseSafe native failure
error: the following build command failed with exit code 1:
D:\a\zig\zig\zig-cache\o\65004e19c710398b8e79252cc8563193\build.exe D:\a\zig\zig\build-release\stage3-release\bin\zig.exe D:\a\zig\zig D:\a\zig\zig\zig-cache C:\Users\runneradmin\AppData\Local\zig --seed 0x68942a54 test docs --zig-lib-dir D:\a\zig\zig\lib --search-prefix D:\a\zig\zig\zig+llvm+lld+clang-x86_64-windows-gnu-0.12.0-dev.888+130227492 -Dstatic-llvm -Dskip-non-native -Denable-symlinks-windows

It easily reproduces for me locally with LLVM 17.0.4 and this command:

$ stage4/bin/zig test ../lib/std/std.zig -target x86_64-windows-msvc -mcpu=znver3 -OReleaseFast
LLVM Emit Object... zig: /home/andy/Downloads/llvm-project-17/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:714: virtual void {anonymous}::X86AsmBackend::applyFixup(const llvm::MCAssembler&, const llvm::MCFixup&, const llvm::MCValue&, llvm::MutableArrayRef<char>, uint64_t, bool, const llvm::MCSubtargetInfo*) const: Assertion `(Size == 0 || isIntN(Size * 8 + 1, SignedValue)) && "Value does not fit in the Fixup field"' failed.
Aborted (core dumped)
LLVM Emit Object... zig: /home/andy/Downloads/llvm-project-17/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:714: virtual void {anonymous}::X86AsmBackend::applyFixup(const llvm::MCAssembler&, const llvm::MCFixup&, const llvm::MCValue&, llvm::MutableArrayRef<char>, uint64_t, bool, const llvm::MCSubtargetInfo*) const: Assertion `(Size == 0 || isIntN(Size * 8 + 1, SignedValue)) && "Value does not fit in the Fixup field"' failed.
Thread 1 "zig" received signal SIGABRT, Aborted.
0x00007ffff7d64adc in __pthread_kill_implementation ()
from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
(gdb) bt
#0 0x00007ffff7d64adc in __pthread_kill_implementation ()
from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#1 0x00007ffff7d15cb6 in raise ()
from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#2 0x00007ffff7cff8ba in abort ()
from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#3 0x00007ffff7cff7d9 in __assert_fail_base.cold ()
from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#4 0x00007ffff7d0e9c6 in __assert_fail ()
from /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6
#5 0x000000000c1103ba in (anonymous namespace)::X86AsmBackend::applyFixup(llvm::MCAssembler const&, llvm::MCFixup const&, llvm::MCValue const&, llvm::MutableArrayRef<char>, unsigned long, bool, llvm::MCSubtargetInfo const*) const ()
#6 0x0000000008e3c060 in llvm::MCAssembler::layout(llvm::MCAsmLayout&) ()
#7 0x0000000008e3c3f5 in llvm::MCAssembler::Finish() ()
#8 0x000000000c4eec16 in llvm::AsmPrinter::doFinalization(llvm::Module&) ()
#9 0x0000000008a4e844 in llvm::FPPassManager::doFinalization(llvm::Module&) ()
#10 0x0000000008a5af84 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#11 0x00000000086fed35 in ZigLLVMTargetMachineEmitToFile ()
#12 0x00000000068bdc7d in codegen.llvm.Object.flushModule (self=0xfada8b0, comp=0xfad7fb0, prog_node=0x7ffffffef5d8) at /home/andy/dev/zig/src/codegen/llvm.zig:1291
#13 0x00000000068c9e8c in link.Coff.flushModule (self=0xfada070, comp=0xfad7fb0, prog_node=0x7ffffffef5d8) at /home/andy/dev/zig/src/link/Coff.zig:1648
#14 0x00000000068c03a7 in link.Coff.lld.linkWithLLD (self=0xfada070, comp=0xfad7fb0, prog_node=0x7ffffffef5d8) at /home/andy/dev/zig/src/link/Coff/lld.zig:34
#15 0x00000000065c4d9b in link.Coff.flush (self=0xfada070, comp=0xfad7fb0, prog_node=0x7ffffffef5d8)
at /home/andy/dev/zig/src/link/Coff.zig:1635
#16 0x00000000062928f3 in link.File.flush (base=0xfada1c8, comp=0xfad7fb0, prog_node=0x7ffffffef5d8)
at link.zig:818
#17 0x00000000062921e6 in Compilation.flush (comp=0xfad7fb0, prog_node=0x7ffffffef5d8)
at Compilation.zig:2398
#18 0x00000000062d5f8d in Compilation.update (comp=0xfad7fb0, main_progress_node=0x7ffffffef5d8)
at Compilation.zig:2355
#19 0x0000000006304613 in main.updateModule (comp=0xfad7fb0) at main.zig:4279
#20 0x00000000063271dd in main.buildOutputType (gpa=..., arena=..., all_args=7 items at 0xfad6800 = {...}, arg_mode=...) at main.zig:3680
#21 0x00000000061387e8 in main.mainArgs (gpa=..., arena=..., args=7 items at 0xfad6800 = {...})
at main.zig:285
#22 0x0000000006135846 in main.main () at main.zig:223
(gdb) 

Next steps:

  1. obtain an LLVM IR reduction
  2. file an upstream bug report
  3. figure out how to disable whatever code is failing so the CI turns green

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86_6464-bit x86backend-llvmThe LLVM backend outputs an LLVM IR Module.bugObserved behavior contradicts documented or intended behavioros-windowsMicrosoft WindowsupstreamAn issue with a third party project that Zig uses.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions