Skip to content

Startup panic with all USB device classes disabled #1541

Description

@amidoinitright

Environment

  • App 0.5.8 (official binary, sha256 ae9616fa...), System 0.2.8
  • microSD-slot hardware variant (RV1106)

Reproduction

  1. In /userdata/kvm_config.json, set all four usb_devices entries to false:
    "absolute_mouse": false, "relative_mouse": false, "keyboard": false, "mass_storage": false
    (serial_console already false; motivation: attempting to stop the no-host rebind loop,
    reported separately)
  2. Reboot.

Observed

jetkvm_app panics during startup init on every boot with this config. Web UI and local display
never come up. The supervisor exits (code 2) and does not keep retrying, leaving the device with no
KVM function until the config is reverted over SSH. A user without developer mode/SSH enabled would
have no recovery path short of reflashing.

2026-07-25T18:20:37Z ??? jetkvm jetkvm JetKVM Starting Up
2026-07-25T18:20:37Z PNC jetkvm jetkvm Received panic error="invalid memory address or nil pointer dereference"
panic: runtime error: invalid memory address or nil pointer dereference [recovered, repanicked]
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x9c37cc]
goroutine 1 [running]:
github.com/jetkvm/kvm.Main.func1()
        github.com/jetkvm/kvm/main.go:38 +0xa0
panic({0xde63f0, 0x23bbd40})
        runtime/panic.go:783 +0xfc
github.com/jetkvm/kvm/internal/usbgadget.(*UsbGadgetTransaction).Commit(0x29c9340)
        github.com/jetkvm/kvm/internal/usbgadget/config_tx.go:102 +0x1c
github.com/jetkvm/kvm/internal/usbgadget.(*UsbGadget).WithTransaction(0x297a108, 0x2847dc0)
        github.com/jetkvm/kvm/internal/usbgadget/config_tx.go:67 +0x1e0
github.com/jetkvm/kvm/internal/usbgadget.(*UsbGadget).configureUsbGadget(...)
        github.com/jetkvm/kvm/internal/usbgadget/config.go:208
github.com/jetkvm/kvm/internal/usbgadget.(*UsbGadget).Init(0x297a108)
        github.com/jetkvm/kvm/internal/usbgadget/config.go:185 +0xec
github.com/jetkvm/kvm/internal/usbgadget.newUsbGadget({0xedd6fd, 0x6}, 0x29a6a60, 0x29c4326, 0x29c6780, 0x29c8dc0)
        github.com/jetkvm/kvm/internal/usbgadget/usbgadget.go:151 +0x3b0
github.com/jetkvm/kvm/internal/usbgadget.NewUsbGadget(...)
        github.com/jetkvm/kvm/internal/usbgadget/usbgadget.go:107
github.com/jetkvm/kvm.initUsbGadget()
        github.com/jetkvm/kvm/usb.go:15 +0x54
github.com/jetkvm/kvm.Main()
        github.com/jetkvm/kvm/main.go:68 +0x35c
main.program()
        ./main.go:37 +0xfc
main.main()
        ./main.go:70 +0x3f4
2026-07-25T18:20:38Z INF jetkvm supervisor error dump saved path=/userdata/jetkvm/crashdump/jetkvm-20260725-182038.log

Expected

Either run cleanly with zero USB functions configured (a reasonable state for a KVM used only for
video capture / with nothing attached), or reject/clamp the config with a logged warning instead of
a startup panic. Note the UI's Classes dropdown offers no "none" option, so this config is only
reachable by editing the file - but the app should still not segfault on it.

Extra

Full supervisor crash dump (28KB, includes diagnostics section) preserved and available on request.
Reverting the four values to true and rebooting restores normal operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions