dundee / gdu

Fast disk usage analyzer with console interface written in Go
MIT License
3.8k stars 138 forks source link

panic: interface conversion #315

Closed axet closed 7 months ago

axet commented 7 months ago

Running 'gdu -d' first time causing a crash. Second run, works fine.

gdu 5.22.0-1+b1 (debian 12)

axet@axet-laptop:~/bin$ gdu -d
panic: interface conversion: interface {} is nil, not *device.Device [recovered]
    panic: interface conversion: interface {} is nil, not *device.Device

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
    github.com/rivo/tview/application.go:243 +0x4d
panic({0x8ca040, 0xc0003500c0})
    runtime/panic.go:884 +0x212
github.com/dundee/gdu/v5/tui.(*UI).deviceItemSelected(0xc0000a4340, 0x8?, 0x1e4?)
    github.com/dundee/gdu/v5/tui/tui.go:228 +0x465
github.com/rivo/tview.(*Table).InputHandler.func1(0xc000024e40, 0x5a5c5f?)
    github.com/rivo/tview/table.go:1577 +0x3c3
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0000ce000?, 0x40ff67?)
    github.com/rivo/tview/box.go:167 +0x53
github.com/rivo/tview.(*Grid).InputHandler.func1(0xc000024e40, 0x5934df?)
    github.com/rivo/tview/grid.go:275 +0x1aa
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0000d0000?, 0x7fe3ce625c08?)
    github.com/rivo/tview/box.go:167 +0x53
github.com/rivo/tview.(*Pages).InputHandler.func1(0x40ff67?, 0x10?)
    github.com/rivo/tview/pages.go:311 +0xa7
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0000b0240?, 0xc0001cd958?)
    github.com/rivo/tview/box.go:167 +0x53
github.com/rivo/tview.(*Application).Run(0xc0000aa000)
    github.com/rivo/tview/application.go:335 +0x77d
github.com/dundee/gdu/v5/tui.(*UI).StartUILoop(0xc0000ac000?)
    github.com/dundee/gdu/v5/tui/tui.go:184 +0x22
github.com/dundee/gdu/v5/cmd/gdu/app.(*App).Run(0xc0000ac000)
    github.com/dundee/gdu/v5/cmd/gdu/app/app.go:164 +0x25c
main.runE(0xc9ad40?, {0xc0001195b0, 0x0, 0x1})
    github.com/dundee/gdu/v5/cmd/gdu/main.go:199 +0x825
github.com/spf13/cobra.(*Command).execute(0xc9ad40, {0xc00012c010, 0x1, 0x1})
    github.com/spf13/cobra/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc9ad40)
    github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
    github.com/spf13/cobra/command.go:968
main.main()
    github.com/dundee/gdu/v5/cmd/gdu/main.go:203 +0x25
dundee commented 7 months ago

Thanks for your report. I think I have found the root cause and fixed it.

axet commented 7 months ago

I know how to reproduce the issue:

1) gdu -d 2) scroll down to the last entry 3) press down again 4) hit enter

dundee commented 7 months ago

Thank you! That helped a lot. I have found the real root cause and fixed it.