Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic after successful sync when running list on 0.18.0 and 0.20.0 #232

Open
cscutcher opened this issue Apr 30, 2023 · 9 comments
Open
Labels

Comments

@cscutcher
Copy link

cscutcher commented Apr 30, 2023

Originally commented on #192 which is most likely unrelated since my issue occurs on list after a seeming successful sync.

Seeing the same thing on Arch Linux either user release binary or Nix (as a package manager)

uname -srvo
Linux 6.1.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 31 Dec 2022 17:40:35 +0000 GNU/Linuxnix run nixpkgs-master#todoist -- list
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6c380d]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.Item.LabelsString({{{{0xc000135a10, 0xa}}, {{0xc000135a20, 0xa}}, {0xc000135a30, 0xc}, {0xc000135a40, 0x8}}, {0x0}, {0x0}, ...}, ...)
        github.com/sachaos/todoist/lib/item.go:215 +0xed
main.List.func1(0xc0002809c0, 0x0?)
        github.com/sachaos/todoist/list.go:72 +0x31b
main.traverseItems(0xc0002809c0, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:13 +0x2e
main.traverseItems(0xc000280888, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000280750, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000280618, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0002804e0, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0002803a8, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000280270, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000280138, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000003180, 0xc0000bebd8, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.List(0xc0000d6420)
        github.com/sachaos/todoist/list.go:58 +0x296
github.com/urfave/cli.HandleAction({0x7b9900?, 0x861398?}, 0x4?)
        github.com/urfave/cli@v1.20.0/app.go:490 +0x5a
github.com/urfave/cli.Command.Run({{0x82ab28, 0x4}, {0x0, 0x0}, {0xc000075400, 0x1, 0x1}, {0x82e4ac, 0xe}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.20.0/command.go:210 +0x8f7
github.com/urfave/cli.(*App).Run(0xc0000dc9c0, {0xc000016040, 0x2, 0x2})
        github.com/urfave/cli@v1.20.0/app.go:255 +0x7e7
main.main()
        github.com/sachaos/todoist/main.go:326 +0x1affnix flake metadata nixpkgs-master
Resolved URL:  github:NixOS/nixpkgs/master
Locked URL:    github:NixOS/nixpkgs/6465e9428e678d178365a3ff2bc88556ad281083
Description:   A collection of packages for the Nix package manager
Path:          /nix/store/mnlxlzwmiq0ag77f7fnqkhdhnzw1zbww-source
Revision:      6465e9428e678d178365a3ff2bc88556ad281083
Last modified: 2023-02-06 13:43:44nix run nixpkgs-master#todoist -- --version
todoist version 0.18.0~/Downloads/todoist_linux_amd64 list
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6bfa6d]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.Item.LabelsString({{{{0xc00019d960, 0xa}}, {{0xc00019d970, 0xa}}, {0xc00019d980, 0xc}, {0xc00019d990, 0x8}}, {0x0}, {0x0}, ...}, ...)
        /Users/sachaos/dev/github.com/sachaos/todoist/lib/item.go:215 +0xed
main.List.func1(0xc0003009c0, 0x0?)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:72 +0x31b
main.traverseItems(0xc0003009c0, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:13 +0x2e
main.traverseItems(0xc000300888, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000300750, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000300618, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003004e0, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003003a8, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000300270, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000300138, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000003180, 0xc000124bd8, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.List(0xc00013c6e0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:58 +0x296
github.com/urfave/cli.HandleAction({0x7b5f00?, 0x85cf50?}, 0x4?)
        /Users/sachaos/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:490 +0x5a
github.com/urfave/cli.Command.Run({{0x82686c, 0x4}, {0x0, 0x0}, {0xc000073400, 0x1, 0x1}, {0x82a219, 0xe}, {0x0, ...}, ...}, ...)
        /Users/sachaos/go/pkg/mod/github.com/urfave/cli@v1.20.0/command.go:210 +0x8f7
github.com/urfave/cli.(*App).Run(0xc000180000, {0xc000014040, 0x2, 0x2})
        /Users/sachaos/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:255 +0x7e7
main.main()
        /Users/sachaos/dev/github.com/sachaos/todoist/main.go:326 +0x1aff~/Downloads/todoist_linux_amd64 --version
todoist version 0.18.0

older versions of nixpkgs have pre 0.18.0 so fail due to (I assume) #201

Originally posted by @cscutcher in #192 (comment)

Checked this again today and still seeing the issue both with the 0.18.0 nix built version and with the 0.20.0 binary from github.
Rather than before where I was running on Arch, I'm now running full NixOS but the error seems the same;

$ ~/Downloads/todoist_linux_amd64 list
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6d63ab]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.Item.LabelsString({{{{0xc0002de332, 0xa}}, {{0xc0002de340, 0xa}}, {0xc000027dc0, 0x1e}, {0xc0002de350, 0x8}}, {0x0}, {0x0}, ...}, ...)
        /Users/sachaos/dev/github.com/sachaos/todoist/lib/item.go:221 +0x20b
...
Full Output
$ ~/Downloads/todoist_linux_amd64 list
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6d63ab]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.Item.LabelsString({{{{0xc0002de332, 0xa}}, {{0xc0002de340, 0xa}}, {0xc000027dc0, 0x1e}, {0xc0002de350, 0x8}}, {0x0}, {0x0}, ...}, ...)
        /Users/sachaos/dev/github.com/sachaos/todoist/lib/item.go:221 +0x20b
main.List.func1(0xc000323c00, 0x0?)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:72 +0x31b
main.traverseItems(0xc000323c00, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:13 +0x2e
main.traverseItems(0xc000323ac8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000323990, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000323240, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000323108, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322e98, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322d60, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322c28, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322af0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003229b8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322880, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322748, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322610, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003224d8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003223a0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000322268, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321ff8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321ec0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321d88, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321b18, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003219e0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321638, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321500, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003213c8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321290, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321158, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000321020, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320ee8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320db0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320c78, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320b40, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320a08, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003208d0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320798, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320660, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320528, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0003203f0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000320180, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031ff10, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031fdd8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031fca0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031fb68, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f8f8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f7c0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f688, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f550, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f418, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f2e0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f1a8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031f070, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031ef38, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031ee00, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031ecc8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031eb90, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031ea58, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031e920, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031e7e8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031e6b0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031e578, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031e440, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031e1d0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031de28, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031dcf0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031dbb8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031da80, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d948, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d810, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d6d8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d5a0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d468, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d330, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d1f8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031d0c0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031cf88, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031ce50, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031cd18, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031cbe0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031caa8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031c970, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031c700, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031c5c8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031c490, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031c358, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031c220, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031c0e8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031bfb0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031be78, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031bd40, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031bc08, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031bad0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031b860, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031b728, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031b5f0, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031b4b8, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031b380, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc00031b248, 0xc0001a8ff0, 0x0)
        /Users/sachaos/dev/github.com/sachaos/todoist/list.go:20 +0x74

As I say sync seems to work fine and the contents of ~/.cache/todoist/cache.json look fine on a casual scan.

I also tried to look for any incidents of subtasks being in the state described by #228 (i.e. uncompleted subtasks with a completed parent task), but couldn't find anything. I also assume I'd not have been able to sync if the issue was related to #228.

@kenliu
Copy link
Collaborator

kenliu commented Apr 30, 2023

Thanks for the detailed bug report @cscutcher

@HacDan
Copy link
Contributor

HacDan commented May 2, 2023

Do you have any special characters in your labels, @cscutcher? That's where things seem to be a bit strange. I seem to remember some issues with labels in the past, but I'm having trouble placing it.

To be clear, I don't think there's an issue with your Todoist setup, I believe this client is possibly not handling certain characters well.

@kenliu kenliu changed the title panic when running list on 0.18.0 and 0.20.0 panic after successful sync when running list on 0.18.0 and 0.20.0 May 2, 2023
@cscutcher
Copy link
Author

@HacDan I don't think so;

$ jq '[.items[].labels[]] | join("") | split("") | unique | join("")' ~/.cache/todoist/cache.json
"-CEMNOSTabcdefghijklmnoprstuvwxy"

(Assuming my jq query makes sense!)

The only place I'm doing anything "interesting", is that I have quite long saved filters that I edit in vim and copypasta into standard todoist UI normally. I'd assume filters are unrelated to this issue, but noting that todoist often groups labels and filters in the same tab;

$ jq '[.filters[].query] | join("") | split("") | unique | join("") ' ~/.cache/todoist/cache.json
" !#&()*,-/0123459:@CFGHILMPRTWabcdefghijklmnoprstuvwxy|"

(I had expected to see a newline or something slip into a filter, but I guess todoist drops those.)

and filter names;

$ jq '[.filters[].name] | join("") | split("") | unique | join("") ' ~/.cache/todoist/cache.json
" &1ADEHMOPRSTWabdeghiklmnorstuvy"

I suppose maybe the & in a filter name?

@HacDan
Copy link
Contributor

HacDan commented May 3, 2023

Well, this one was pretty fun to track down. I don't have a fix yet, but I spent a few minutes playing with the cache and the special characters from your labels.

It seems it's the - character in your label name. Which is interesting, because I use _ without issue in my label names.

I'll dig into this tonight or tomorrow, as this should be patched, as it's a very expected use case.

I did confirm, if it helps anyway, that the & in your filter names is not causing issues, it's just the - character in the label names.

@HacDan
Copy link
Contributor

HacDan commented May 7, 2023

I haven't made any progress here outside of being able to reproduce this issue. If someone else wants to look into this, please feel free!

@cscutcher
Copy link
Author

Thanks for looking into that. Unfortunately, the workaround doesn't seem to work or at least removing - from my tags didn't help ;

$ nix run nixpkgs#todoist -- sync && nix run nixpkgs#todoist -- list ; jq '[.items[].labels[]] | join("") | split("") | unique | join("")' ~/.cache/todoist/cache.json

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6df1ab]

goroutine 1 [running]:
github.com/sachaos/todoist/lib.Item.LabelsString({{{{0xc0003761c2, 0xa}}, {{0xc0003761d0, 0xa}}, {0xc00017bbe0, 0x1e}, {0xc0003761e0, 0x8}}, {0x0}, {0x0}, ...}, ...)
        github.com/sachaos/todoist/lib/item.go:221 +0x20b
main.List.func1(0xc000409c00, 0x0?)
        github.com/sachaos/todoist/list.go:72 +0x31b
main.traverseItems(0xc000409c00, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:13 +0x2e
main.traverseItems(0xc000409ac8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000409990, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000409240, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000409108, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408e98, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408d60, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408c28, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408af0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004089b8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408880, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408748, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408610, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004084d8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004083a0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000408268, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407ff8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407ec0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407d88, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407b18, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004079e0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407638, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407500, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004073c8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407290, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407158, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000407020, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406ee8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406db0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406c78, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406b40, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406a08, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004068d0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406798, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406660, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406528, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004063f0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000406180, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405f10, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405dd8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405ca0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405b68, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004058f8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004057c0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405688, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405550, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405418, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004052e0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004051a8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000405070, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404f38, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404e00, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404cc8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404b90, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404a58, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404920, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004047e8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004046b0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404578, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000404440, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004041d0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403e28, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403cf0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403bb8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403a80, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403948, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403810, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004036d8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004035a0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403468, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000403330, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004031f8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004030c0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402f88, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402e50, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402d18, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402be0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402aa8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402970, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402700, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004025c8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402490, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402358, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000402220, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004020e8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401fb0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401e78, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401d40, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401c08, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401ad0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401860, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401728, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004015f0, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc0004014b8, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401380, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
main.traverseItems(0xc000401248, 0xc00021eff0, 0x0)
        github.com/sachaos/todoist/list.go:20 +0x74
"CEMNOST_abcdefghijklmnoprstuvwxy"

@fabiocorneti
Copy link

I am experiencing this issue and in my case it is caused by the fact that some tasks have shared labels in addition to personal labels.

The sync API only returns personal labels (https://developer.todoist.com/sync/v9/#labels), so the func below returns an empty string and that triggers the panic as the ID of the shared label is not found: https://github.com/sachaos/todoist/blob/master/lib/label.go#L25

This looks a bit tricky to fix as todoist-cli would need to retrieve shared labels using the REST api and keep them in some other json file in order to display them.

@cscutcher
Copy link
Author

Good spot! FWIW, I also use shared labels.

@amildahl
Copy link

amildahl commented Nov 7, 2023

I'm experiencing this as well with a fresh install of 0.20.0. My labels are all camel case, so there are no other symbols like -. I am using a single shared label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants