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

failed assertion in writeManifest consecutively using zig build run #19947

Closed
xdBronch opened this issue May 12, 2024 · 1 comment · Fixed by #19956
Closed

failed assertion in writeManifest consecutively using zig build run #19947

xdBronch opened this issue May 12, 2024 · 1 comment · Fixed by #19956
Labels
bug Observed behavior contradicts documented or intended behavior regression It worked in a previous version of Zig, but stopped working. zig build system
Milestone

Comments

@xdBronch
Copy link
Contributor

xdBronch commented May 12, 2024

Zig Version

0.13.0-dev.201+86d8688c7

Steps to Reproduce and Observed Behavior

reproducible with the project from zig init, run zig build run more than once without editing any files
hits a failed assertion with this stack trace

thread 1385711 panic: reached unreachable code
/home/user/zig/lib/std/debug.zig:403:14: 0x10b636d in assert (build)
    if (!ok) unreachable; // assertion failure
             ^
/home/user/zig/lib/std/Build/Cache.zig:896:15: 0x11ec1bd in writeManifest (build)
        assert(self.have_exclusive_lock);
              ^
/home/user/zig/lib/std/Build/Step.zig:554:26: 0x11ecb69 in writeManifest (build)
        man.writeManifest() catch |err| {
                         ^
/home/user/zig/lib/std/Build/Step/Run.zig:713:31: 0x1186f98 in make (build)
        try step.writeManifest(&man);
                              ^
/home/user/zig/lib/std/Build/Step.zig:182:13: 0x11390be in make (build)
    s.makeFn(s, prog_node) catch |err| switch (err) {
            ^
/home/user/zig/lib/compiler/build_runner.zig:948:31: 0x10f385d in workerMakeOneStep (build)
    const make_result = s.make(&sub_prog_node);
                              ^
/home/user/zig/lib/std/Thread/Pool.zig:102:39: 0x10f41f2 in runFn (build)
            @call(.auto, func, closure.arguments);
                                      ^
/home/user/zig/lib/std/Thread/Pool.zig:191:18: 0x115fd64 in worker (build)
            runFn(&run_node.data);
                 ^
/home/user/zig/lib/std/Thread.zig:408:13: 0x1137b7d in callFn__anon_14474 (build)
            @call(.auto, f, args);
            ^
/home/user/zig/lib/std/Thread.zig:1226:30: 0x10f3087 in entryFn (build)
                return callFn(f, self.fn_args);
                             ^
/home/user/zig/lib/c.zig:239:13: 0x12a4400 in clone (c)
            asm volatile (
            ^

id guess this is from #19939 since the added line is right before the panic

Expected Behavior

no error

@xdBronch xdBronch added the bug Observed behavior contradicts documented or intended behavior label May 12, 2024
@andrewrk andrewrk added zig build system regression It worked in a previous version of Zig, but stopped working. labels May 12, 2024
@andrewrk andrewrk added this to the 0.13.0 milestone May 12, 2024
@andrewrk
Copy link
Member

I think this is mainly due to has_side_effects being no longer an early return case like it was before #19826. If it has side effects it shouldn't be calling cache.hit().

cc @jacobly0 - sorry I missed this in the review.

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 regression It worked in a previous version of Zig, but stopped working. zig build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants