pms icon indicating copy to clipboard operation
pms copied to clipboard

Nil pointer dereference when starting PMS in certain terminals

Open tremby opened this issue 6 years ago • 8 comments

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

tremby avatar Aug 07 '17 07:08 tremby

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

carnager avatar Aug 29 '17 15:08 carnager

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.

kimtore avatar Sep 20 '17 13:09 kimtore

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

danarnold avatar May 28 '19 18:05 danarnold

Can confirm this bug for kitty

mpldr avatar Dec 07 '19 22:12 mpldr

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?

kimtore avatar Dec 10 '19 14:12 kimtore

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

mpldr avatar Dec 11 '19 18:12 mpldr

@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).

kimtore avatar Dec 11 '19 22:12 kimtore

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

The index file does not exist yet.

mpldr avatar Dec 11 '19 22:12 mpldr