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

build --watch panics on debian linux (name_to_handle_at returns .INVAL) #20720

Open
dimdin opened this issue Jul 21, 2024 · 1 comment
Open
Labels
bug Observed behavior contradicts documented or intended behavior incremental compilation Problem occurs only when reusing compiler state. os-linux zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@dimdin
Copy link

dimdin commented Jul 21, 2024

Zig Version

0.14.0-dev.367 a57479afc

Steps to Reproduce and Observed Behavior

❯ uname -srm
Linux 6.1.0-22-amd64 x86_64

❯ zig-dev version
0.14.0-dev.367 a57479afc

❯ zig-dev build test --watch
Build Summary: 3/3 steps succeeded
test success
└─ run test-recover success 478us MaxRSS:1M
thread 487331 panic: reached unreachable code
/home/din/zig/master/lib/std/posix.zig:7318:19: 0x112fb98 in name_to_handle_atZ (build)
        .INVAL => unreachable, // bad flags, or handle_bytes too big
                  ^
/home/din/zig/master/lib/std/posix.zig:7305:30: 0x10f6bf7 in name_to_handle_at (build)
    return name_to_handle_atZ(dirfd, &pathname_c, handle, mount_id, flags);
                             ^
/home/din/zig/master/lib/std/Build/Watch.zig:101:40: 0x10f677e in getDirHandle (build)
            try posix.name_to_handle_at(path.root_dir.handle.fd, adjusted_path, stack_ptr, &mount_id, std.os.linux.AT.HANDLE_FID);
                                       ^
/home/din/zig/master/lib/std/Build/Watch.zig:161:67: 0x10fcc3c in update (build)
                            const dir_handle = try Os.getDirHandle(gpa, path);
                                                                  ^
/home/din/zig/master/lib/std/Build/Watch.zig:323:35: 0x10fda98 in update (build)
        .linux => return Os.update(w, gpa, steps),
                                  ^
/home/din/zig/master/lib/compiler/build_runner.zig:405:21: 0x110363f in main (build)
        try w.update(gpa, run.step_stack.keys());
                    ^
/home/din/zig/master/lib/std/start.zig:532:37: 0x10de985 in posixCallMainAndExit (build)
            const result = root.main() catch |err| {
                                    ^
/home/din/zig/master/lib/std/start.zig:277:5: 0x10de4a1 in _start (build)
    asm volatile (switch (native_arch) {
    ^
???:?:?: 0xa in ??? (???)
Unwind information for `???:0xa` was not available, trace may be incomplete

error: the following build command crashed:
/home/din/src/zig-recover/.zig-cache/o/a1ff0bdedd6e79a7f0ca2eeccf2c252c/build /home/din/zig/master/zig /home/din/zig/master/lib /home/din/src/zig-recover /home/din/src/zig-recover/.zig-cache /home/din/.cache/zig --seed 0xa2fd6fbd -Z7be4afe0b650cc74 test --watch

Expected Behavior

Not expecting a panic. Expecting to watch and run tests when dependencies change.

@dimdin dimdin added the bug Observed behavior contradicts documented or intended behavior label Jul 21, 2024
@andrewrk andrewrk added this to the 0.14.0 milestone Jul 22, 2024
@andrewrk andrewrk added zig build system std.Build, the build runner, `zig build` subcommand, package management incremental compilation Problem occurs only when reusing compiler state. labels Jul 22, 2024
@dimdin
Copy link
Author

dimdin commented Jul 27, 2024

flag AT.STATX_SYNC_AS_STAT is available since linux 6.5
by replacing the flag with the AT.STATX_SYNC_AS_STAT=0, watch worked on linux 6.1

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 incremental compilation Problem occurs only when reusing compiler state. os-linux zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

No branches or pull requests

2 participants