bensadeh / circumflex

🌿 It's Hacker News in your terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runtime error: invalid memory address or nil pointer dereference

krmbzds opened this issue · comments

I get the following error when I try to run go run main.go (same with prebuilt binary).

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

goroutine 52 [running]:
clx/hn/services/hybrid.mapStories(0x0)
        /tmp/tmp.LyjH2Hoy4p/circumflex/hn/services/hybrid/hybrid.go:99 +0x3e
clx/hn/services/hybrid.(*Service).FetchItems(0xc00002e060?, 0x2d, 0x1?)
        /tmp/tmp.LyjH2Hoy4p/circumflex/hn/services/hybrid/hybrid.go:45 +0x40d
clx/bubble/list.(*Model).FetchFrontPageStories.func1()
        /tmp/tmp.LyjH2Hoy4p/circumflex/bubble/list/list.go:114 +0x96
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6.1()
        /home/foo/.asdf/installs/golang/1.19.1/packages/pkg/mod/github.com/charmbracelet/bubbletea@v0.22.1/tea.go:469 +0x33
created by github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func6
        /home/foo/.asdf/installs/golang/1.19.1/packages/pkg/mod/github.com/charmbracelet/bubbletea@v0.22.1/tea.go:467 +0x14d
exit status 2

System info:

Pop!_OS 22.04 LTS
Linux 5.19.0-76051900-generic x86_64
go version go1.19.1 linux/amd64
tmux 3.3a
alacritty 0.10.1-rc1

Hi @krmbzds

Thanks for letting me know about this. Right now this is a bit difficult for me to debug since it is not something I can reproduce on my machine. I will try and see if I can find something out based on the panic.

Had the same bug when starting circumflex in zsh. Worked fine in bash

Had the same bug when starting circumflex in zsh. Worked fine in bash

@jspruyt Thanks for letting me know! I created a terminal profile with /bin/bash as login shell to test this out. No luck. I still get the same error message.

GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
GNOME Terminal 3.44.0 using VTE 0.68.0 +BIDI +GNUTLS +ICU +SYSTEMD

It looks like an issue with fetching the initial submission lists.

Are you able to manually fetch results from the endpoints in your browsers?

Submission list: https://hacker-news.firebaseio.com/v0/topstories.json

Details for each item: https://hn.algolia.com/api/v1/search?tags=story,(story_33281106,story_33281682,story_33278698,story_33283674,story_33258410,story_33283712,story_33276342,story_33275935,story_33276601,story_33281310,story_33284659,story_33281148,story_33279036,story_33282883,story_33263567,story_33268199,story_33279290,story_33275418,story_33277865,)&hitsPerPage=19

For 2.7 I am planning to add an option for logging to make troubleshooting easier, as well as better error messages.

Hey, that's it! I had to whitelist hn.algolia.com in my firewall and now it works. Thank you!

Glad it works! Thanks again for submitting the ticket, it is helpful for me to know so I can create more useful error messages in the future.