lsr can trigger a panic in zeit #4

Open opened by knightpp.bsky.social

The panic happens on https://github.com/rockorager/zeit/blob/f86d568b89a5922f084dae524a1eaf709855cd5e/src/timezone.zig#L700

This only happens when I lsr -l /nix/store using --release=safe mode.

/home/user/.cache/zig/p/zeit-0.6.0-5I6bk1J1AgA13rteb6E0steXiOUKBYTzJZMMIuK9oEmb/src/timezone.zig:700:55: 0x105189e in main (lsr)
            if (i == 0 and transition.ts > timestamp) @panic("unimplemented. please complain to tim");
                                                      ^
/nix/store/bz98w0a559adr7jjai4v1wz70jk8cd9s-zig-0.14.0/lib/zig/std/start.zig:656:37: 0x1044aab in posixCallMainAndExit (lsr)
            const result = root.main() catch |err| {
                                    ^
/nix/store/bz98w0a559adr7jjai4v1wz70jk8cd9s-zig-0.14.0/lib/zig/std/start.zig:271:5: 0x104449d in _start (lsr)
    asm volatile (switch (native_arch) {
    ^
???:?:?: 0x0 in ??? (???)
fish: Job 1, './zig-out/bin/lsr -l /nix/store' terminated by signal SIGABRT (Abort)

This panic happens when the earliest transition date of the timezone file is newer than the timestamp...It's not trivial to implement (I have a TODO comment to copy what Go / C do).

For my own reference, what is earliest date shown in if you list that directory with /usr/bin/ls?

Sign up or Sign in to add to the discussion.