Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index out of bounds in build Step zigProcessUpdate beginning in 0.14.0-dev.544+7aaebd177 #20787

Closed
scheibo opened this issue Jul 25, 2024 · 2 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@scheibo
Copy link
Sponsor Contributor

scheibo commented Jul 25, 2024

Zig Version

0.14.0-dev.564+75cf7fca9

Steps to Reproduce and Observed Behavior

$ git clone https://github.com/scheibo/zigpkg.git
$ cd zigpkg/examples/zig
$ zig build --summary all -Dadd run -- 40
/Users/kjs/Downloads/zigpkg/examples/zig
thread 11744183 panic: index out of bounds: index 0, len 0
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Build/Step.zig:549:103: 0x102f8787f in zigProcessUpdate (build)
                    const prefix_index: std.zig.Server.Message.PathPrefix = @enumFromInt(prefixed_path[0] - 1);
                                                                                                      ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Build/Step.zig:441:40: 0x102f8a8d3 in evalZigProcess (build)
    const result = try zigProcessUpdate(s, zp, watch);
                                       ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Build/Step/Compile.zig:1762:54: 0x102f33a0f in make (build)
    const maybe_output_bin_path = step.evalZigProcess(
                                                     ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Build/Step.zig:231:13: 0x102ed7b7f in make (build)
    s.makeFn(s, options) catch |err| switch (err) {
            ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/compiler/build_runner.zig:1045:31: 0x102ea0197 in workerMakeOneStep (build)
    const make_result = s.make(.{
                              ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Thread/Pool.zig:115:39: 0x102ea0adf in runFn (build)
            @call(.auto, func, closure.arguments);
                                      ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Thread/Pool.zig:291:32: 0x102f0284b in worker (build)
            run_node.data.runFn(&run_node.data, id);
                               ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Thread.zig:409:13: 0x102ed641f in callFn__anon_14792 (build)
            @call(.auto, f, args);
            ^
/Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib/std/Thread.zig:678:30: 0x102e9f7a3 in entryFn (build)
                return callFn(f, args_ptr.*);
                             ^
???:?:?: 0x1993f2f93 in ??? (libsystem_pthread.dylib)
???:?:?: 0x8c330001993edd33 in ??? (???)
error: the following build command crashed:
/Users/kjs/Downloads/zigpkg/examples/zig/.zig-cache/o/d52ae6637c08cac9ed90d95a1031dfaf/build /Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/zig /Users/kjs/Code/src/github.com/scheibo/zig/build/zig-macos-aarch64-0.14.0-dev.564+75cf7fca9/lib /Users/kjs/Downloads/zigpkg/examples/zig /Users/kjs/Downloads/zigpkg/examples/zig/.zig-cache /Users/kjs/.cache/zig --seed 0x2dba4e0a -Ze9407efbbf133562 --summary all -Dadd run -- 40
make: *** [zig-example] Error 1

Expected Behavior

42
Build Summary: 6/6 steps succeeded
run success
+- run example success 467us MaxRSS:1M
   +- zig build-exe example Debug native success 1s MaxRSS:179M
   |  +- options success
   +- install success
      +- install example success
         +- zig build-exe example Debug native (+1 more reused dependencies)

This works on 0.14.0-dev.367+a57479afc and started failing on 0.14.0-dev.544+7aaebd177, though still repros in the latest nightly (0.14.0-dev.564+75cf7fca9)

@scheibo scheibo added the bug Observed behavior contradicts documented or intended behavior label Jul 25, 2024
@Vexu
Copy link
Member

Vexu commented Jul 25, 2024

Looks like #20713

@scheibo
Copy link
Sponsor Contributor Author

scheibo commented Jul 25, 2024

oof yes, thank you. I'll close this as a dupe and reopen if the fix for that doesn't also fix this issue.

@scheibo scheibo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants