Skip to content

raceconditions #125

@adrian4096

Description

@adrian4096

I ran into

thread 546199 panic: switch on corrupt value
Unwind error at address `:0x10c36e3` (error.AddressOutOfRange), trace may be incomplete

/home/adrian/.cache/zig/p/httpz-0.0.0-PNVzrGu3BgAIRvYiWsbvVbzUyZg1-rzoT71hVSeLCHz7/src/worker.zig:564:49: 0x125efa3 in run (httpz.zig)
                        .recv => |conn| switch (conn.protocol) {
                                                ^
/home/adrian/projects/tar/zig-linux/lib/std/Thread.zig:488:13: 0x1236ab8 in callFn__anon_33979 (std.zig)
            @call(.auto, f, args);
            ^
/home/adrian/projects/tar/zig-linux/lib/std/Thread.zig:757:30: 0x12127cd in entryFn (std.zig)
                return callFn(f, args_ptr.*);
                             ^
aborting due to recursive panic

while creating 100 connections to a slow endpoint (1.65s avg. lat.)

with for x in {0..100}; do curl http://localhost:1024/api/1 --output /dev/null & done

After that i compiled with threadsan and came across a lot of raceconditions.
I think most of theese should be fixed asap as they seem to be causing real problems.

https://pastebin.com/SbDL8Z1a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions