bus1 / dbus-broker

Linux D-Bus Message Broker
https://github.com/bus1/dbus-broker/wiki
Apache License 2.0
675 stars 78 forks source link

Assertion `c_assert_result && "((uint32_t)-1) - n_uid + 1 >= uid_start"' failed #263

Closed rkakrik closed 3 years ago

rkakrik commented 3 years ago

Hi! I can't boot arch linux with dbus-broker 28:

мар 18 10:33:41 srv systemd[1]: Failed to start D-Bus System Message Bus.
мар 18 10:33:41 srv systemd[1]: dbus-broker.service: Failed with result 'core-dump'.
мар 18 10:33:41 srv systemd[1]: dbus-broker.service: Start request repeated too quickly.
мар 18 10:33:34 srv systemd[1]: Failed to start D-Bus System Message Bus.
мар 18 10:33:34 srv systemd[1]: dbus-broker.service: Failed with result 'core-dump'.
мар 18 10:33:34 srv systemd[1]: dbus-broker.service: Start request repeated too quickly.
мар 18 10:33:34 srv systemd[1]: dbus-broker.service: Failed with result 'core-dump'.
мар 18 10:33:34 srv systemd[1]: dbus-broker.service: Main process exited, code=dumped, status=6/ABRT
мар 18 10:33:34 srv dbus-broker[2355]: Dispatched 0 messages @ 0(±0)μs / message.
мар 18 10:33:34 srv dbus-broker-launch[2354]: dbus-broker-launch: ../dbus-broker/src/launch/policy.c:937: policy_export_console: Assertion `c_assert_result && "((uint32_t)-1) - n_uid + 1 >= uid_start"' failed.
мар 18 10:33:34 srv systemd[1]: Started D-Bus System Message Bus.
мар 18 10:33:34 srv dbus-broker-launch[2354]: Deprecated policy context in /usr/share/dbus-1/system.d/iwd-dbus.conf +21. The 'at_console' context is deprecated and will be ignored in the future.
мар 18 10:33:34 srv dbus-broker-launch[2354]: Deprecated policy context in /usr/share/dbus-1/system.d/ead-dbus.conf +21. The 'at_console' context is deprecated and will be ignored in the future.
мар 18 10:33:34 srv dbus-broker-launch[2354]: NSS returned no entry for 'lxdm'
мар 18 10:33:34 srv dbus-broker-launch[2354]: Looking up NSS user entry for 'lxdm'...
мар 18 10:33:34 srv systemd[1]: Starting D-Bus System Message Bus...
           PID: 398 (dbus-broker-lau)
           UID: 0 (root)
           GID: 0 (root)
        Signal: 6 (ABRT)
     Timestamp: Thu 2021-03-18 10:19:26 +05 (32min ago)
  Command Line: /usr/bin/dbus-broker-launch --scope system --audit
    Executable: /usr/bin/dbus-broker-launch
 Control Group: /system.slice/dbus-broker.service
          Unit: dbus-broker.service
         Slice: system.slice
       Boot ID: bc5dbee888274de697b1694c8ea50627
    Machine ID: ce9815cf615e491e8c34a6ae6b0e663e
      Hostname: srv
       Storage: /var/lib/systemd/coredump/core.dbus-broker-lau.0.bc5dbee888274de697b1694c8ea50627.398.1616044766000000.zst
       Message: Process 398 (dbus-broker-lau) of user 0 dumped core.

                Stack trace of thread 398:
                #0  0x00007fd9a4010ef5 raise (libc.so.6 + 0x3cef5)
                #1  0x00007fd9a3ffa862 abort (libc.so.6 + 0x26862)
                #2  0x00007fd9a3ffa747 __assert_fail_base.cold (libc.so.6 + 0x26747)
                #3  0x00007fd9a4009646 __assert_fail (libc.so.6 + 0x35646)
                #4  0x000055675b72f8d8 n/a (dbus-broker-launch + 0xf8d8)
                #5  0x000055675b732126 n/a (dbus-broker-launch + 0x12126)
                #6  0x000055675b72dfa3 n/a (dbus-broker-launch + 0xdfa3)
                #7  0x000055675b723507 n/a (dbus-broker-launch + 0x3507)
                #8  0x00007fd9a3ffbb25 __libc_start_main (libc.so.6 + 0x27b25)
                #9  0x000055675b72383e n/a (dbus-broker-launch + 0x383e)
dvdhrm commented 3 years ago

Thanks for the report! I can see one situation where this assertion can be incorrectly triggered. Mainly if either you have an at_console policy configured for root, or for >1 users with consecutive UIDs. I fixed the assertion in 1add8a7d60e46806e0ef87994d3024245db0d84a.

This code did not change in the v28 release. Did you just now switch to dbus-broker? Or did this actually not trigger before for you?

Anyway, thanks for the report!

rkakrik commented 3 years ago

This code did not change in the v28 release. Did you just now switch to dbus-broker? Or did this actually not trigger before for you?

No, I am a fan of dbus-broker from the very beginning) I use it everywhere, but it stopped working on the desktop long ago, there was no time to debug. Now I compiled the version from the git - everything works. Thank you so much)

dvdhrm commented 3 years ago

This code did not change in the v28 release. Did you just now switch to dbus-broker? Or did this actually not trigger before for you?

No, I am a fan of dbus-broker from the very beginning) I use it everywhere, but it stopped working on the desktop long ago, there was no time to debug. Now I compiled the version from the git - everything works. Thank you so much)

Cool! Glad this is fixed. Thanks a lot for the report!