Skip to content

zig std crash, infinite loading #24897

Description

@obivan

Zig Version

0.15.0-dev.1564+2761cc8be

Steps to Reproduce and Observed Behavior

I'm trying to view the standard library documentation offline.

$ zig version
0.15.0-dev.1564+2761cc8be

When I run the command:

$ zig std --no-open-browser
http://127.0.0.1:44203/

The documentation web page shows the status "Loading..." forever, but there are no errors or crashes.

If I run with ZIG_DEBUG_CMD=1, the process crashes when I open a web page in the browser:

$ ZIG_DEBUG_CMD=1 zig std --no-open-browser
http://127.0.0.1:34651/
thread 86472 panic: reached unreachable code
/home/vko/.local/bin/zig-lang/lib/std/http.zig:896:25: 0x120e5d2 in endChunkedUnflushed (std.zig)
                else => unreachable, // An earlier write call indicated more data would follow.
                        ^
/home/vko/.local/bin/zig-lang/lib/std/http.zig:844:51: 0x11c841b in endUnflushed (std.zig)
            .chunked => return endChunkedUnflushed(w, .{}),
                                                  ^
/home/vko/.local/bin/zig-lang/lib/std/http.zig:818:25: 0x119ee0f in end (std.zig)
        try endUnflushed(w);
                        ^
/home/vko/.local/bin/zig-lang/lib/compiler/std-docs.zig:230:21: 0x117f6d9 in serveSourcesTar (std-docs.zig)
    try response.end();
                    ^
/home/vko/.local/bin/zig-lang/lib/compiler/std-docs.zig:141:28: 0x1180533 in serveRequest (std-docs.zig)
        try serveSourcesTar(request, context);
                           ^
/home/vko/.local/bin/zig-lang/lib/compiler/std-docs.zig:109:21: 0x1180ed5 in accept (std-docs.zig)
        serveRequest(&request, context) catch |err| {
                    ^
/home/vko/.local/bin/zig-lang/lib/std/Thread.zig:510:13: 0x1172e7a in callFn__anon_26080 (std.zig)
            @call(.auto, f, args);
            ^
/home/vko/.local/bin/zig-lang/lib/std/Thread.zig:1382:30: 0x116c3dd in entryFn (std.zig)
                return callFn(f, self.fn_args);
                             ^
/home/vko/.local/bin/zig-lang/lib/std/os/linux/x86_64.zig:119:5: 0x1172b95 in clone (std.zig)
    asm volatile (
    ^
???:?:?: 0x0 in ??? (???)
[1]    86053 abort (core dumped) ZIG_DEBUG_CMD=1 zig std --no-open-browser

Expected Behavior

There are no process crashes, documentation is shown on the web page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions