Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed assertion in check_video_adapters_list_implements_drm #422

Open
maralorn opened this issue May 23, 2024 · 1 comment
Open

Failed assertion in check_video_adapters_list_implements_drm #422

maralorn opened this issue May 23, 2024 · 1 comment
Labels

Comments

@maralorn
Copy link

maralorn commented May 23, 2024

Hello and thank you for ddcutil!

After updating my system (to nixos-24.05) I am experiencing crashes when running ddcutil (2.1.4) from within the systemd-udevd systemd (255.6) services. The same command works when run as my user so this is not necessarilly a bug in ddcutil and I suspect it has something to do with the hardening of the systemd unit. The systemd unit runs as root so it is not simply the missing i2c group, I think.

(EDIT): The same setup worked fine before the update (ddcutil 2.0.0). Leaving the new system as is but using ddcutil 2.0.0 fixes the problem. So maybe this is actually some kind of regression.

           PID: 692027 (ddcutil)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 6 (ABRT)
     Timestamp: Fri 2024-05-24 00:31:04 CEST (57min ago)
  Command Line: /nix/store/s9nim482nrzaxd7y2divg8i56l542ax3-ddcutil-2.1.4/bin/ddcutil -l $'DELL S2721QS' setvcp 60 15
    Executable: /nix/store/s9nim482nrzaxd7y2divg8i56l542ax3-ddcutil-2.1.4/bin/ddcutil
 Control Group: /system.slice/systemd-udevd.service/udev
          Unit: systemd-udevd.service
         Slice: system.slice
       Boot ID: 0f769c3491ad415ba02734b7b4f30a8c
    Machine ID: 56308aa9949b4926946f1c9146b0819d
      Hostname: zeus
       Storage: /var/lib/systemd/coredump/core.ddcutil.0.0f769c3491ad415ba02734b7b4f30a8c.692027.1716503464000000.zst (inacces>
       Message: Process 692027 (ddcutil) of user 0 dumped core.
                
                Module libcap.so.2 without build-id.
                Module libpcre2-8.so.0 without build-id.
                Module libdrm.so.2 without build-id.
                Module libusb-1.0.so.0 without build-id.
                Module libudev.so.1 without build-id.
                Module libjansson.so.4 without build-id.
                Module ddcutil without build-id.
                Stack trace of thread 692027:
                #0  0x00007f2c57d69efc __pthread_kill_implementation (libc.so.6 + 0x8fefc)
                #1  0x00007f2c57d19e86 raise (libc.so.6 + 0x3fe86)
                #2  0x00007f2c57d02935 abort (libc.so.6 + 0x28935)
                #3  0x00007f2c57d02859 __assert_fail_base.cold (libc.so.6 + 0x28859)
                #4  0x00007f2c57d126e6 __assert_fail (libc.so.6 + 0x386e6)
                #5  0x0000556d3afb94d3 check_video_adapters_list_implements_drm (ddcutil + 0x9e4d3)
                #6  0x0000556d3afb94f8 check_all_video_adapters_implement_drm (ddcutil + 0x9e4f8)
                #7  0x0000556d3af6d3e4 submaster_initializer (ddcutil + 0x523e4)
                #8  0x0000556d3af5c860 main (ddcutil + 0x41860)
                #9  0x00007f2c57d0410e __libc_start_call_main (libc.so.6 + 0x2a10e)
                #10 0x00007f2c57d041c9 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x2a1c9)
                #11 0x0000556d3af5d8f5 _start (ddcutil + 0x428f5)
                ELF object binary architecture: AMD x86-64

The systemd unit is this here: https://github.com/systemd/systemd/blob/c09f7e5a8208fab5680bfeba8df5707887a8c080/units/systemd-udevd.service.in
and the udev rule (although probably irrelevant)

ACTION=="add", ENV{DEVTYPE}=="usb_device", ENV{PRODUCT}=="3496/6/100", RUN+="/nix/store/s9nim482nrzaxd7y2divg8i56l542ax3-ddcutil-2.1.4/bin/ddcutil -l \"DELL S2721QS\" setvcp 60 15

Thanks in advance!

@rockowitz
Copy link
Owner

Thanks for the report.

I have hardened branch 2.1.5-dev to avoid the abort.

However, there's a more fundamental problem. Release 2.x makes extensive use of /sys and drm in an attempt to improve performance. However, it turns out that there is variation in how video drivers populate /sys. (What is your hardware platform, what is the video driver?) In your case, it appears that /sys is not fully populated when ddcutil is run by systemd at startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants