rockowitz / ddcutil

Control monitor settings using DDC/CI and USB
http://www.ddcutil.com
GNU General Public License v2.0
946 stars 38 forks source link

Ddcutil crashes when some usb devices are connected #437

Open AurelienDevGames opened 1 month ago

AurelienDevGames commented 1 month ago

Hi,

Without fail if I restart my system with my Thrustmaster Rudder Pedals connected, ddcutil crashes the boot sequence forcing me to power down manually. This does not happen if it is a simple power up, only on restart.

I have a multi monitor setup on Fedora 40 KDE.

Ddcutil-interrogate verbose ddcutil-interrogate.txt

inxi -FGxx

  Host: fedora Kernel: 6.9.9-200.fc40.x86_64 arch: x86_64 bits: 64
    compiler: gcc v: 2.41-37.fc40
  Desktop: KDE Plasma v: 6.1.3 tk: Qt v: N/A wm: kwin_wayland dm: SDDM
    Distro: Fedora Linux 40 (KDE Plasma)
Machine:
  Type: Desktop System: MATERIEL.NET product: NEMESIS v: V1
    serial: <superuser required>
  Mobo: ASUSTeK model: TUF GAMING B550-PLUS v: Rev X.0x
    serial: <superuser required> part-nu: AR202311210162
    UEFI: American Megatrends v: 3607 date: 03/18/2024
CPU:
  Info: 8-core model: AMD Ryzen 7 5800X bits: 64 type: MT MCP arch: Zen 3+
    rev: 2 cache: L1: 512 KiB L2: 4 MiB L3: 32 MiB
  Speed (MHz): avg: 2241 high: 2856 min/max: 2200/4850 boost: enabled cores:
    1: 2200 2: 2200 3: 2200 4: 2200 5: 2200 6: 2200 7: 2200 8: 2200 9: 2200
    10: 2200 11: 2200 12: 2200 13: 2200 14: 2200 15: 2856 16: 2200
    bogomips: 121606
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3
Graphics:
  Device-1: AMD Navi 32 [Radeon RX 7700 XT / 7800 XT] driver: amdgpu v: kernel
    arch: RDNA-3 pcie: speed: 16 GT/s lanes: 16 ports: active: DP-2,HDMI-A-1
    empty: DP-1,DP-3,Writeback-1 bus-ID: 0a:00.0 chip-ID: 1002:747e
  Device-2: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-9.2:10 chip-ID: 046d:0825
  Display: wayland server: Xwayland v: 24.1.1 compositor: kwin_wayland
    driver: X: loaded: modesetting alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu d-rect: 3840x1080 display-ID: 0
  Monitor-1: DP-2 pos: primary,left res: 1920x1080 size: N/A
  Monitor-2: HDMI-A-1 pos: right res: 1920x1080 size: N/A
  API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: swrast
    surfaceless: drv: radeonsi wayland: drv: radeonsi x11: drv: radeonsi
    inactive: gbm
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.1.4 glx-v: 1.4
    direct-render: yes renderer: AMD Radeon RX 7800 XT (radeonsi navi32 LLVM
    18.1.6 DRM 3.57 6.9.9-200.fc40.x86_64) device-ID: 1002:747e
    display-ID: :0.0
  API: Vulkan v: 1.3.283 surfaces: xcb,xlib,wayland device: 0
    type: discrete-gpu driver: N/A device-ID: 1002:747e device: 1 type: cpu
    driver: N/A device-ID: 10005:0000
Audio:
  Device-1: AMD Navi 31 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie:
    speed: 16 GT/s lanes: 16 bus-ID: 0a:00.1 chip-ID: 1002:ab30
  Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: speed: 16 GT/s lanes: 16
    bus-ID: 0c:00.4 chip-ID: 1022:1487
  Device-3: HP HyperX Virtual Surround Sound
    driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 2.0 speed: 12 Mb/s
    lanes: 1 bus-ID: 1-9.1:9 chip-ID: 03f0:0b92
  Device-4: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 1-9.2:10 chip-ID: 046d:0825
  API: ALSA v: k6.9.9-200.fc40.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8125 2.5GbE vendor: ASUSTeK driver: r8169 v: kernel
    pcie: speed: 5 GT/s lanes: 1 port: f000 bus-ID: 07:00.0 chip-ID: 10ec:8125
  IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: e8:9c:25:7e:a9:a9
Bluetooth:
  Device-1: Realtek Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.1
    speed: 12 Mb/s lanes: 1 bus-ID: 1-3:3 chip-ID: 0bda:8771
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: 00:E0:4C:86:C8:03
    bt-v: 5.1 lmp-v: 10
Drives:
  Local Storage: total: 2.75 TiB used: 651.04 GiB (23.1%)
  ID-1: /dev/nvme0n1 vendor: Kingston model: SKC3000S1024G size: 953.87 GiB
    speed: 63.2 Gb/s lanes: 4 serial: 50026B7382A52A28 temp: 36.9 C
  ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO Plus 2TB
    size: 1.82 TiB speed: 31.6 Gb/s lanes: 4 serial: S4J4NX0W584629W
    temp: 46.9 C
Partition:
  ID-1: / size: 1.82 TiB used: 650.62 GiB (35.0%) fs: btrfs
    dev: /dev/nvme1n1p3
  ID-2: /boot size: 973.4 MiB used: 385.8 MiB (39.6%) fs: ext4
    dev: /dev/nvme1n1p1
  ID-3: /boot/efi size: 95 MiB used: 45.6 MiB (48.0%) fs: vfat
    dev: /dev/nvme1n1p2
  ID-4: /home size: 1.82 TiB used: 650.62 GiB (35.0%) fs: btrfs
    dev: /dev/nvme1n1p3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 49.2 C mobo: N/A gpu: amdgpu temp: 52.0 C
    mem: 69.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 0
Info:
  Memory: total: 32 GiB available: 31.25 GiB used: 4.32 GiB (13.8%)
  Processes: 410 Power: uptime: 11m wakeups: 0 Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: pm: flatpak pkgs: 22 Compilers: clang: 18.1.6 alt: 17
    gcc: 14.1.1 Shell: Zsh v: 5.9 running-in: kitty inxi: 3.3.34

journalctl -xb-1

[...]
Jul 22 15:00:10 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-resolved comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jul 22 15:00:10 fedora systemd[1]: Reached target network.target - Network.
░░ Subject: A start job for unit network.target has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit network.target has finished successfully.
░░ 
░░ The job identifier is 240.
Jul 22 15:00:10 fedora systemd[1]: Reached target network-online.target - Network is Online.
░░ Subject: A start job for unit network-online.target has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit network-online.target has finished successfully.
░░ 
░░ The job identifier is 235.
Jul 22 15:00:10 fedora systemd[1]: Reached target nss-lookup.target - Host and Network Name Lookups.
░░ Subject: A start job for unit nss-lookup.target has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit nss-lookup.target has finished successfully.
░░ 
░░ The job identifier is 162.
Jul 22 15:00:10 fedora systemd[1]: Starting rpc-statd-notify.service - Notify NFS peers of a restart...
░░ Subject: A start job for unit rpc-statd-notify.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit rpc-statd-notify.service has begun execution.
░░ 
░░ The job identifier is 273.
Jul 22 15:00:10 fedora systemd-update-utmp[958]: Failed to get the current runlevel, utmp update skipped.
Jul 22 15:00:10 fedora systemd[1]: systemd-update-utmp-runlevel.service: Deactivated successfully.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit systemd-update-utmp-runlevel.service has successfully entered the 'dead' state.
Jul 22 15:00:10 fedora systemd[1]: Finished systemd-update-utmp-runlevel.service - Record Runlevel Change in UTMP.
░░ Subject: A start job for unit systemd-update-utmp-runlevel.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit systemd-update-utmp-runlevel.service has finished successfully.
░░ 
░░ The job identifier is 304.
Jul 22 15:00:10 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-update-utmp-runlevel comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jul 22 15:00:10 fedora audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-update-utmp-runlevel comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jul 22 15:00:10 fedora sm-notify[959]: Version 2.6.4 starting
Jul 22 15:00:10 fedora systemd-coredump[927]: Process 766 (ddcutil) of user 0 dumped core.

                                              Module libcap.so.2 from rpm libcap-2.69-8.fc40.x86_64
                                              Module libpcre2-8.so.0 from rpm pcre2-10.44-1.fc40.x86_64
                                              Module libdrm.so.2 from rpm libdrm-2.4.121-1.fc40.x86_64
                                              Module libudev.so.1 from rpm systemd-255.8-1.fc40.x86_64
                                              Module libglib-2.0.so.0 from rpm glib2-2.80.3-1.fc40.x86_64
                                              Module libjansson.so.4 from rpm jansson-2.13.1-9.fc40.x86_64
                                              Module ddcutil from rpm ddcutil-2.1.2-1.fc40.x86_64
                                              Stack trace of thread 766:
                                              #0  0x00007f8479d6ab9d __strlen_avx2 (libc.so.6 + 0x16fb9d)
                                              #1  0x00005612391ec991 strsplit (ddcutil + 0x8c991)
                                              #2  0x00005612391fd1ac avoid_device_by_usb_interfaces_property_string (ddcutil + 0x9d1ac)
                                              #3  0x00005612391fd482 is_possible_monitor_by_hiddev_name (ddcutil + 0x9d482)
                                              #4  0x00005612391fd5b0 check_usb_monitor (ddcutil + 0x9d5b0)
                                              #5  0x000056123917d8f8 main (ddcutil + 0x1d8f8)
                                              #6  0x00007f8479c25088 __libc_start_call_main (libc.so.6 + 0x2a088)
                                              #7  0x00007f8479c2514b __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2a14b)
                                              #8  0x000056123917da45 _start (ddcutil + 0x1da45)
                                              ELF object binary architecture: AMD x86-64
░░ Subject: Process 766 (ddcutil) dumped core
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ Documentation: man:core(5)
░░ 
░░ Process 766 (ddcutil) crashed and dumped core.
░░ 
░░ This usually indicates a programming error in the crashing program and
░░ should be reported to its vendor as a bug.
Jul 22 15:00:10 fedora systemd-coredump[925]: Process 764 (ddcutil) of user 0 dumped core.

                                              Module libcap.so.2 from rpm libcap-2.69-8.fc40.x86_64
                                              Module libpcre2-8.so.0 from rpm pcre2-10.44-1.fc40.x86_64
                                              Module libdrm.so.2 from rpm libdrm-2.4.121-1.fc40.x86_64
                                              Module libudev.so.1 from rpm systemd-255.8-1.fc40.x86_64
                                              Module libglib-2.0.so.0 from rpm glib2-2.80.3-1.fc40.x86_64
                                              Module libjansson.so.4 from rpm jansson-2.13.1-9.fc40.x86_64
                                              Module ddcutil from rpm ddcutil-2.1.2-1.fc40.x86_64
                                              Stack trace of thread 764:
                                              #0  0x00007fa51e0cbb9d __strlen_avx2 (libc.so.6 + 0x16fb9d)
                                              #1  0x000055b6daa4d991 strsplit (ddcutil + 0x8c991)
                                              #2  0x000055b6daa5e1ac avoid_device_by_usb_interfaces_property_string (ddcutil + 0x9d1ac)
                                              #3  0x000055b6daa5e482 is_possible_monitor_by_hiddev_name (ddcutil + 0x9d482)
                                              #4  0x000055b6daa5e5b0 check_usb_monitor (ddcutil + 0x9d5b0)
                                              #5  0x000055b6da9de8f8 main (ddcutil + 0x1d8f8)
                                              #6  0x00007fa51df86088 __libc_start_call_main (libc.so.6 + 0x2a088)
                                              #7  0x00007fa51df8614b __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2a14b)
                                              #8  0x000055b6da9dea45 _start (ddcutil + 0x1da45)
                                              ELF object binary architecture: AMD x86-64
░░ Subject: Process 764 (ddcutil) dumped core
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ Documentation: man:core(5)
░░ 
░░ Process 764 (ddcutil) crashed and dumped core.
░░ 
░░ This usually indicates a programming error in the crashing program and
░░ should be reported to its vendor as a bug.
Jul 22 15:00:10 fedora audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=rpc-statd-notify comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

coredump.zip

rockowitz commented 1 month ago

Ugh. I thought I had posted an extensive response to go along with the labels assigned 4 days ago. In summary:

The immediate cause of the crash had been fixed by commit 196f3 in branch 2.1.5-dev, in response to issue #405. This occurred when the device name property was not set when the udev rule in 60-ddcutil.rules was processed.

The rule gives the logged on user RW permission to any /dev/usb/hiddev* device associated with a monitor that uses USB communication to communicate with its Virtual Control Panel, and which adheres to the USB Device Class Definition for Human Interface Devices. Such monitors have proven extremely rare.

With commit d7416 in branch 2.1.5-dev, ddcutil chkusbmon returns immediately if option disable-usb has been specified in the ddcutil configuration file.

If ddcutil is built with configure option --enable-usb=no, ddcutil is built without support for USB communication. In this case command ddcutil chkusbmon is not built, and the udev rule is not installed.

As an alternative to building from branch 2.1.5-dev, you can simply delete file /usr/lib/udev/rules.d/60-ddcutil-usb.rules.