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

Segfault if not run in a term #123

Closed jvasile closed 4 years ago

jvasile commented 4 years ago

While in an emacs eshell, I did a git clone, make, then make install, then:

`$ pms Practical Music Search 1ef37a8 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x95f849]

goroutine 1 [running]: github.com/ambientsound/pms/widgets.(UI).Start(...) /home/james/src/practical_music_search/widgets/ui.go:101 github.com/ambientsound/pms/pms.(PMS).setupUI(0xc0001402d0) /home/james/src/practical_music_search/pms/setup.go:74 +0xa9 github.com/ambientsound/pms/pms.New(0xacc29f) /home/james/src/practical_music_search/pms/setup.go:41 +0x60d main.main() /home/james/src/practical_music_search/main.go:94 +0x1ef`

I didn't try to debug beyond a very simple fix: I ran it in a proper terminal (xterm and also emacs's term). It was silly not to do that from the beginning, but I didn't realize this needed a tty since I didn't actually know anything about it.

Suggested remediation: return a proper, informative error message instead of seg faulting. Add a line to documentation.

Other than that, this is a minor issue.

kimtore commented 4 years ago

Hi @jvasile,

Latest master should fix this error. Unfortunately I could not reproduce this behavior, would you mind taking it for a spin and see how it behaves?