Skip to content

Segmentation fault when logging url #43

Description

@myclevorname

When running zon2nix in debug mode, I get the following segfault:

[clevor@clevor-laptop-nixos:~/Code/zig/todo/zon2nix]$ zig master build run -- ../
anyzig: appdata '/home/clevor/.local/share/anyzig'
anyzig: downloading 'https://ziglang.org/download/index.json' to '/home/clevor/.local/share/anyzig/download-index.json'
anyzig: master is at 0.15.0-dev.532+a3693aae3
anyzig: zig '0.15.0-dev.532+a3693aae3' already exists at '/home/clevor/.cache/zig/p/N-V-__8AAFIWwhN2QtfFJhf-ga5lm4s0UKJ9UUhwxFhGidxr'
debug: running "nix flake prefetch --json --extra-experimental-features 'flakes nix-command' git+https://github.com/david-vanderson/dvui?rev=13a86d035894087fd8414b0e3b045f487b8ca84d"
debug: running "nix flake prefetch --json --extra-experimental-features 'flakes nix-command' git+https://github.com/ziglibs/known-folders?rev=aa24df42183ad415d10bc0a33e6238c437fc0f59"
debug: nix prefetch for "https://github.com/david-vanderson/dvui" returned: {"hash":"sha256-zatZxGGqs5R8SDJX/2QM75wgivshEbpnWa3wQrLOBb8=","locked":{"__final":true,"lastModified":1747080799,"ref":"refs/heads/main","rev":"13a86d035894087fd8414b0e3b045f487b8ca84d","revCount":1793,"type":"git","url":"https://github.com/david-vanderson/dvui"},"original":{"rev":"13a86d035894087fd8414b0e3b045f487b8ca84d","type":"git","url":"https://github.com/david-vanderson/dvui"},"storePath":"/nix/store/84v3sxpaayd4544xba2f7ijyf0a10mjy-source"}

debug: hash for "https://github.com/david-vanderson/dvui" is sha256-zatZxGGqs5R8SDJX/2QM75wgivshEbpnWa3wQrLOBb8=
Segmentation fault at address 0x7f1b863c0d48
/home/clevor/Code/zig/todo/zon2nix/src/fetch.zig:81:71: 0x10ff5a1 in fetch (zon2nix)
            log.debug("nix prefetch for \"{s}\" returned: {s}", .{ dep.url, buf });
                                                                      ^
/home/clevor/Code/zig/todo/zon2nix/src/main.zig:63:14: 0x1103225 in main (zon2nix)
    try fetch(gpa, &deps);
             ^
/home/clevor/.cache/zig/p/N-V-__8AAFIWwhN2QtfFJhf-ga5lm4s0UKJ9UUhwxFhGidxr/lib/std/start.zig:671:37: 0x10f9628 in posixCallMainAndExit (zon2nix)
            const result = root.main() catch |err| {
                                    ^
/home/clevor/.cache/zig/p/N-V-__8AAFIWwhN2QtfFJhf-ga5lm4s0UKJ9UUhwxFhGidxr/lib/std/start.zig:282:5: 0x10f91cd in _start (zon2nix)
    asm volatile (switch (native_arch) {
    ^
???:?:?: 0x0 in ??? (???)
run
└─ run zon2nix failure
error: the following command terminated unexpectedly:
/home/clevor/Code/zig/todo/zon2nix/zig-out/bin/zon2nix ../ 
Build Summary: 4/6 steps succeeded; 1 failed
run transitive failure
└─ run zon2nix failure
error: the following build command failed with exit code 1:
/home/clevor/Code/zig/todo/zon2nix/.zig-cache/o/46761711e1372a4d4069ed1e4563b2ed/build /home/clevor/.cache/zig/p/N-V-__8AAFIWwhN2QtfFJhf-ga5lm4s0UKJ9UUhwxFhGidxr/zig /home/clevor/.cache/zig/p/N-V-__8AAFIWwhN2QtfFJhf-ga5lm4s0UKJ9UUhwxFhGidxr/lib /home/clevor/Code/zig/todo/zon2nix /home/clevor/Code/zig/todo/zon2nix/.zig-cache /home/clevor/.cache/zig --seed 0xefc71dea -Z0b68ecff244def6c run -- ../

Reproduction:

git clone https://github.com/myclevorname/todo-list --revision d0a5a3dc9ef8f39b4deef169f83fc50a0b26c32a
cd todo-list
git clone https://github.com/nix-community/zon2nix --revision 2360e358c2107860dadd340f88b25d260b538188
cd zon2nix
nix run github:NixOS/nixpkgs/d89fc19e405cb2d55ce7cc114356846a0ee5e956#zig -- build run -- ../

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions