sachaos / todoist

Todoist CLI Client. I ❤️ Todoist and CLI.
MIT License
1.49k stars 105 forks source link

Panic when running list on Linux #254

Open skykosiner opened 8 months ago

skykosiner commented 8 months ago

I'm running version 0.18.0 from the aur It was working fine till the other day when randomly it was panicking, I've listed the output below.

$ todoist-cli list --filter '(today | overdue)'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6e7b77]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.Item.LabelsString({{{{0xc0001fabc0, 0xa}}, {{0xc0001fabd0, 0xa}}, {0xc0001fab98, 0x8}, {0xc0001fabe0, 0x8}}, {0x0}, {0x0}, ...}, ...)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/lib/item.go:215 +0x1f7
main.List.func1(0xc0002255f0, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:72 +0x31b
main.traverseItems(0xc0002255f0, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:13 +0x28
main.traverseItems(0xc000225248, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224ea0, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224d68, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224c30, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224af8, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc0002249c0, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224888, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224750, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224618, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc0002244e0, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc0002243a8, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224270, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000224138, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.traverseItems(0xc000143900, 0xc00016b140, 0x0)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:20 +0x69
main.List(0xc000025080)
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/list.go:58 +0x3b6
github.com/urfave/cli/v2.(*Command).Run(0xc0001b8000, 0xc000025080, {0xc0001c5500, 0x3, 0x3})
    /home/sky/.cache/yay/todoist/src/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/command.go:274 +0x93f
github.com/urfave/cli/v2.(*Command).Run(0xc0001b9340, 0xc000024940, {0xc000024080, 0x4, 0x4})
    /home/sky/.cache/yay/todoist/src/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/command.go:267 +0xb7d
github.com/urfave/cli/v2.(*App).RunContext(0xc0001b6000, {0x969bd8, 0xca2120}, {0xc000024080, 0x4, 0x4})
    /home/sky/.cache/yay/todoist/src/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/app.go:332 +0x566
github.com/urfave/cli/v2.(*App).Run(...)
    /home/sky/.cache/yay/todoist/src/go/pkg/mod/github.com/urfave/cli/v2@v2.25.1/app.go:309
main.main()
    /home/sky/.cache/yay/todoist/src/go/src/github.com/sachaos/todoist/main.go:345 +0x1d0c
krisezra87 commented 8 months ago

I also had a panic issue on arch until I moved all shared labels to personal labels (as discussed in the panic on windows thread). Seems to work for me now.