Skip to content

Conversation

@Jarred-Sumner
Copy link
Contributor

The following snippet segfaults on Linux when host points to a domain that can't be resolved:

test "segfault" {
    const std = @import("std");
    var host = "hellooooooooooooooo.1.2.3.4.5.6.67.com";
    var addrinfo: *std.c.addrinfo = undefined;
    _ = std.c.getaddrinfo(
        host,
        null,
        null,
        &addrinfo,
    );
    defer std.c.freeaddrinfo(addrinfo);
}

image

Stop reason: signal SIGSEGV: invalid address (fault address: 0x0)

@Vexu
Copy link
Member

Vexu commented Jan 19, 2023

remote: Permission to oven-sh/zig.git denied to Vexu.
fatal: unable to access 'https://github.com/oven-sh/zig/': The requested URL returned error: 403

#14377

@Vexu Vexu closed this Jan 19, 2023
@paperclover paperclover deleted the jarred/type-definition-of-getaddrinfo-is-incorrect branch June 7, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants