kimtore / pms

Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.
https://ambientsound.github.io/pms/
MIT License
249 stars 23 forks source link

Nil pointer dereference when starting PMS in certain terminals #66

Open tremby opened 7 years ago

tremby commented 7 years ago

PMS runs fine for me in urxvt, but in st (both 0.4.1, which is packaged in my distro's repo, and the latest master) I get the following error:

Practical Music Search undefined
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x825d02]

goroutine 1 [running]:
github.com/ambientsound/pms/widgets.(*UI).Start(0x0)
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/widgets/ui.go:107 +0x22
github.com/ambientsound/pms/pms.(*PMS).setupUI(0xc42015ba00)
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/pms/setup.go:74 +0xb3
github.com/ambientsound/pms/pms.New(0x952563)
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/pms/setup.go:42 +0x92c
main.main()
        /home/tremby/src/gocode/src/github.com/ambientsound/pms/main.go:66 +0x2f1
carnager commented 7 years ago

also happens on termite (which is vte3 based) but then again works fine with gnome-terminal

kimtore commented 6 years ago

I'm considering switching to the termbox-go library instead of tcell. I tested termbox-go on st and it works. tcell uses a compile-time terminfo library, maybe that's why it works.

The tcell Application based event loop is going to be removed at one point in favor of PMS' own event loop setup. The widgets and styles from tcell are nice, however. Unsure about the amount of work that would be required to replicate today's functionality.

danarnold commented 5 years ago

I get this on macOS with iTerm2 3.2.9. I have no issues in the native Terminal.app, alacritty, and Therm.

mpldr commented 4 years ago

Can confirm this bug for kitty

kimtore commented 4 years ago

Newest build tested with iTerm2 3.3.6 and AlacriTTY 0.4.0, with no problems. Please give it another shot and see if this fixes anything for you?

mpldr commented 4 years ago
columns="artist,track,title,album,year,time"panic: runtime error: invalid memory address or nil pointer dereference
                                            [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8adf4f]

                                           goroutine 41 [running]:
                                                                  github.com/ambientsound/pms/index.(*Index).IndexFull(0x0, 0xfe8f78, 0x0, 0x0, 0xc000392150, 0xb82480, 0x437b46)
                                    /home/moritz/Projects/Go/pms/index/index.go:175 +0xdf
                      github.com/ambientsound/pms/songlist.(*Library).ReIndex.func1(0xc00016c360)
                            /home/moritz/Projects/Go/pms/songlist/library.go:109 +0x7f
                   created by github.com/ambientsound/pms/songlist.(*Library).ReIndex
                /home/moritz/Projects/Go/pms/songlist/library.go:107 +0x92

is all I get when running with Alacritty 0.4.0-1

kimtore commented 4 years ago

@poldi1405, the backtrace shows that you hit another bug which I think is probably unrelated to which terminal you're running.

Can you try to delete PMS' index file, then run it again? (should be in your XDG cache directory which is usually ~/.cache/pms).

mpldr commented 4 years ago

Thought so too, that's why I opened #122

The index file does not exist yet.