Skip to content

std.Build.Step.Compile.create with Options.use_llvm = false breaks fuzz testing #23423

@Paladynee

Description

@Paladynee

Zig Version

0.15.0-dev.97+677b2d62e

Steps to Reproduce and Observed Behavior

similar to #20990 in nature.

$ zig version
0.15.0-dev.97+677b2d62e

Minimal repro:

  1. zig init
  2. in build.zig change exe_unit_tests:
const exe_unit_tests = b.addTest(.{
    .root_module = exe_mod,
    .use_llvm = false,
});
  1. zig build test --fuzz
    Observed behavior:
eurydice@serenity:~/coreign/minimal$ zig build test --fuzz
info: web interface listening at http://127.0.0.1:37931/
info: hint: pass --port 37931 to use this same port next time
thread 59931 panic: start index 1 is larger than end index 0
/snap/zig/13959/lib/std/Build/Fuzz/WebServer.zig:685:17: 0x159270e in addEntryPoint (build)
        for (pcs[1..], 1..) |elem_addr, i| {
                ^
/snap/zig/13959/lib/std/Build/Fuzz/WebServer.zig:566:56: 0x154148d in coverageRun (build)
            .entry_point => |entry_point| addEntryPoint(ws, entry_point.coverage_id, entry_point.addr) catch |err| switch (err) {
                                                       ^
/snap/zig/13959/lib/std/Thread.zig:510:13: 0x1507afd in callFn__anon_71977 (build)
            @call(.auto, f, args);
            ^
/snap/zig/13959/lib/std/Thread.zig:1403:30: 0x14c3ee1 in entryFn (build)
                return callFn(f, self.fn_args);
                             ^
/snap/zig/13959/lib/std/os/linux/x86_64.zig:126:5: 0x14bc6c1 in clone (build)
    asm volatile (
    ^
???:?:?: 0x0 in ??? (???)
error: the following build command crashed:
/home/eurydice/coreign/minimal/.zig-cache/o/fdcab04bb682fef78333aab175a3a144/build /snap/zig/13959/zig /snap/zig/13959/lib /home/eurydice/coreign/minimal /home/eurydice/coreign/minimal/.zig-cache /home/eurydice/.cache/zig --seed 0x6a556cf9 -Zbf398f7019233e9f test --fuzz

Expected Behavior

Expected to see normal fuzzer results:

eurydice@serenity:~/coreign/minimal$ zig build test --fuzz
info: web interface listening at http://127.0.0.1:39513/
info: hint: pass --port 39513 to use this same port next time
[0/1] Fuzzing
└─ main.test.fuzz example

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend-self-hostedbugObserved behavior contradicts documented or intended behaviorfuzzing

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions