ls but with io_uring

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?

Most dates are set to the Unix epoch (Dec 31 1969)

dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2zvjnwwalnvnx3q0m337yh3yw2p6b6g9-perl5.40.0-Test-RequiresInternet-0.05
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 303islqk386z1w2g1ngvxnkl4glfpgrs-glibc-2.40-66-bin
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ thread 63341 panic: unimplemented. please complain to tim
Unwind information for `exe:0x106295b` was not available, trace may be incomplete

???:?:?: 0x104c8a1 in ??? (exe)
???:?:?: 0x1042804 in ??? (exe)
???:?:?: 0x10423ad in ??? (exe)

Some dates were set to build time, or when the NixOS system was rebuilt

drwxr-xr-x   1 root root    31592704 Jun  4 20:50 .links

I'm a bit confused why many folders with the same epoch date do not panic and show instead:

...
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2fikflsfbsymb9jia8l2chqshxbqqjas-gnugrep-3.11_fish-completions
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2g37f33slw8764fhpvi4pasi1cirvrq1-gmp-with-cxx-6.3.0
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2gy63y2rk9mgahm6brc1aabqrnd6mn8n-vimplugin-treesitter-grammar-facility
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2h9wpl00dsqjm4fi3p8c60kd20vsq9ls-ghostty-1.1.3-fish-completions
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2hwfgz4l61d6b2lzjx98ni1913la3v38-vimplugin-treesitter-grammar-gnuplot
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2i5yzhnlk4p47ngbw2ap5fcfq5s6qj8l-opentelemetry-sdk-1.33.1
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2if7n092rmql4qc12xlq05dwj7fwhlcy-starlark-grammar-0.0.0+rev=a453dbf
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ 2irmh7sawmhyir2wd3and0nffmk9ha4l-speex-1.2.1
dr-xr-xr-x root   root         -  31 Dec  1969 ๓ฐ‰‹ thread 64308 panic: unimplemented. please complain to tim

I can reproduce this issue but only in ReleaseSafe mode. in Debug and in ReleaseFast mode it works as expected (tested on git main branch)

sign up or login to add to the discussion
Labels

None yet.

Participants 4
AT URI
at://did:plc:3zsjx5jgd6dbi4orckspsqiq/sh.tangled.repo.issue/3lp7uwdqnvv22