Skip to content

unable to codegen: InputOutput on Linux with Self-Hosted x86 Backend #22642

Open
@jcalabro

Description

Zig Version

0.14.0-dev.2577+271452d22

Steps to Reproduce and Observed Behavior

Hello! I've been getting this issue on occasion (i.e. see here) and I'm not certain how to reproduce it. However, it's been happening roughly once or twice a day. This is happening across multiple development machines.

Using Linux, use_llvm = false, and use_lld = false, I get an error where the compiler appears to be unable to generate some amount of code. An example of a full run is below the fold, however this previously was also happening at different lines of source code. My code is valid and compiles correctly if I re-run the compiler.

I'm not sure how to reliably reproduce this, and the bug does not appear to happen when I swap back to using llvm and lld. I'm happy to work with the team to get towards a more reliable repro case, but for the time being, I'd encourage you to try compiling uscope a handful of times. Not a great repro at all, I know, but that's the only thing I have to go on at the moment. Happy to run any commands or do any investigation you need, but I'm not sure what direction to go in to explore that space on my own.

Here's my linux version:

$ uname -a
Linux jlinux02 6.9.12-3-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Aug  7 16:19:28 UTC 2024 x86_64 GNU/Linux
Reveal full log
$ zig build run -Dllvm=false
run
└─ run uscope
   └─ zig build-exe uscope Debug native 4 errors
/home/jcalabro/zig/0.14.0-dev.2577+271452d22/files/lib/std/array_list.zig:873:13: error: unable to codegen: InputOutput
        pub fn append(self: *Self, allocator: Allocator, item: T) Allocator.Error!void {
        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jcalabro/zig/0.14.0-dev.2577+271452d22/files/lib/std/Thread/ResetEvent.zig:97:5: error: unable to codegen: InputOutput
    fn isSet(self: *const Impl) bool {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jcalabro/zig/0.14.0-dev.2577+271452d22/files/lib/std/array_list.zig:1071:13: error: unable to codegen: InputOutput
        pub fn clearAndFree(self: *Self, allocator: Allocator) void {
        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/logging.zig:152:5: error: unable to codegen: InputOutput
    fn write(self: Self, comptime fmt: []const u8, args: anytype, lvl: Level, color: Color) void {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the following command failed with 4 compilation errors:
/home/jcalabro/zig/0.14.0-dev.2577+271452d22/files/zig build-exe -freference-trace=256 -fno-llvm -fno-lld libs/stb_image/stb_image.c /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/56b9db104173fd9f
26e69957b98b3fc0/libcimgui.a /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/5bc08949cd41183f339ca82b193f0867/libglfw.a /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/3f6636ed6662bb2
ff5e29e00c0ff907a/libtracy.a -fno-strip -fno-stack-check -fno-stack-protector -fno-omit-frame-pointer -fsanitize-c -fno-sanitize-thread -ODebug -I libs/stb_image -I libs/spall -I /home/jcalabro/go/src/github.com
/jcalabro/uscope/.zig-cache/o/5b558e2516e4e7306483d8098d0260b2 -I /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/b35a3097dc77cf0d0d230a4246e72488 -I /home/jcalabro/go/src/github.com/jcalabro/uscop
e/.zig-cache/o/dda5e4cbcb3d85361226cc79822690f1 -L /home/jcalabro/.cache/zig/p/122047a9298c4c9dd43389d418d6826d469b192246ba0944102964cdc57f94c562df/linux/lib/x86_64-linux-gnu --dep build_options --dep time --dep
 cimgui --dep zglfw --dep zopengl --dep ztracy -Mroot=/home/jcalabro/go/src/github.com/jcalabro/uscope/src/main.zig -Mbuild_options=/home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/c/dec4e5122db4f3eb2
7bab209140d6d68/options.zig -ODebug -Mtime=/home/jcalabro/.cache/zig/p/1220f43a23ab22f4a151477923e986cbfeb01a7970f57e85ea78fb17b3fcdb21d88d/time.zig -ODebug -I /home/jcalabro/go/src/github.com/jcalabro/uscope/li
bs/cimgui/vendor --dep cimgui_options -Mcimgui=/home/jcalabro/go/src/github.com/jcalabro/uscope/libs/cimgui/main.zig -I /home/jcalabro/.cache/zig/p/1220aac39fd472cb7a70b1987249f3ac73799e702ff27516d799e1d5e566097
f0a8b/libs/glfw/include -isystem /home/jcalabro/.cache/zig/p/122047a9298c4c9dd43389d418d6826d469b192246ba0944102964cdc57f94c562df/linux/include --dep zglfw_options -Mzglfw=/home/jcalabro/.cache/zig/p/1220aac39fd
472cb7a70b1987249f3ac73799e702ff27516d799e1d5e566097f0a8b/src/zglfw.zig -Mzopengl=/home/jcalabro/.cache/zig/p/1220c030f5e33e09bd80fe7a7b064b65e1fc02e9bbf603ba04716866c9f1ca16f8ce/src/zopengl.zig --dep ztracy_opt
ions --dep c -Mztracy=/home/jcalabro/.cache/zig/p/1220293b509e9238e43828b00ee18e38eeace190ef844b74bf54e3db6e7da7398f4b/src/ztracy.zig -Mcimgui_options=/home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/
c/746885799fd6f893b726ce323bb12121/options.zig -Mzglfw_options=/home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/c/1bcfb49a1bce1294f8f42b738f3b4df2/options.zig -Mztracy_options=/home/jcalabro/go/src/gi
thub.com/jcalabro/uscope/.zig-cache/c/cca47235f59fffbec51bdd11f8fa681a/options.zig -ODebug -Mc=/home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/d97633c3cf0189dd54b0620394970d8c/TracyC.zig /home/jcal
abro/go/src/github.com/jcalabro/uscope/.zig-cache/o/7c5c4ea6ba0e3822f22aad7e38826b7a/libfreetype.a -lX11 /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/287469d3ee77ac4cd51d316c054bba3a/libz.a /hom
e/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/702fe321ddb2cc9246e9f701a863ede4/libpng.a /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/287469d3ee77ac4cd51d316c054bba3a/libz.a -lc++ -lc
 --cache-dir /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache --global-cache-dir /home/jcalabro/.cache/zig --name uscope --zig-lib-dir /home/jcalabro/zig/0.14.0-dev.2577+271452d22/files/lib/ --listen=
-
Build Summary: 17/20 steps succeeded; 1 failed
run transitive failure
└─ run uscope transitive failure
   └─ zig build-exe uscope Debug native 4 errors
error: the following build command failed with exit code 1:
/home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache/o/9a44a38fdd32013faf683cc49d0f11a8/build /home/jcalabro/zig/0.14.0-dev.2577+271452d22/files/zig /home/jcalabro/zig/0.14.0-dev.2577+271452d22/files/lib
/home/jcalabro/go/src/github.com/jcalabro/uscope /home/jcalabro/go/src/github.com/jcalabro/uscope/.zig-cache /home/jcalabro/.cache/zig --seed 0x7414d245 -Z53243822e146505b -freference-trace run -freference-trace

Expected Behavior

I expect my code to compile and run correctly. My code actually does compile correctly if I re-run the zig build run command.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.use caseDescribes a real use case that is difficult or impossible, but does not propose a solution.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions