dbus issueshttps://gitlab.freedesktop.org/dbus/dbus/-/issues2022-02-18T07:36:11Zhttps://gitlab.freedesktop.org/dbus/dbus/-/issues/377Building docs with CMake fails2022-02-18T07:36:11ZJan TojnarBuilding docs with CMake failsBuilding 758d37b1f8784a3849a764b8cfa7f1d824aa5da4 with CMake fails for me:
```
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI ...Building 758d37b1f8784a3849a764b8cfa7f1d824aa5da4 with CMake fails for me:
```
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/pja9g36cy32z3d51942jqk91a6l2d5nv-gcc-wrapper-10.3.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Generate config.h.in with autogen.sh to enable cmake header difference check.
Unusual CMAKE_INSTALL_LIBDIR: the generated package will not be relocatable.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /nix/store/r255i42fsinsmjpywxzj8rsav51vx4b5-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libsystemd>=209'
-- Found libsystemd, version 249
-- Checking for module 'systemd'
-- Found systemd, version 249
-- Found EXPAT: /nix/store/hwzah8ba3p9pwwv9zwdy5ysw8m7sljjw-expat-2.4.4/lib/libexpat.so (found version "2.4.4")
-- Found X11: /nix/store/y33ngsql2d5mg57j231gk8c90347xy3b-xorgproto-2021.5/include
-- Looking for XOpenDisplay in /nix/store/6pdb0rz2w2hsfsy66kwrbz67jd424wv7-libX11-1.7.2/lib/libX11.so
-- Looking for XOpenDisplay in /nix/store/6pdb0rz2w2hsfsy66kwrbz67jd424wv7-libX11-1.7.2/lib/libX11.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Could NOT find GLIB2 (missing: GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for byteswap.h
-- Looking for byteswap.h - found
-- Looking for crt/externs.h
-- Looking for crt/externs.h - not found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for expat.h
-- Looking for expat.h - found
-- Looking for grp.h
-- Looking for grp.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for io.h
-- Looking for io.h - not found
-- Looking for locale.h
-- Looking for locale.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for syslog.h
-- Looking for syslog.h - found
-- Looking for 3 include files stdint.h, ..., sys/event.h
-- Looking for 3 include files stdint.h, ..., sys/event.h - not found
-- Looking for sys/inotify.h
-- Looking for sys/inotify.h - found
-- Looking for sys/random.h
-- Looking for sys/random.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sys/uio.h
-- Looking for sys/uio.h - found
-- Looking for sys/prctl.h
-- Looking for sys/prctl.h - found
-- Looking for sys/syslimits.h
-- Looking for sys/syslimits.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for time.h
-- Looking for time.h - found
-- Looking for ws2tcpip.h
-- Looking for ws2tcpip.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for sys/inotify.h
-- Looking for sys/inotify.h - found
-- Looking for backtrace
-- Looking for backtrace - found
-- Looking for getgrouplist
-- Looking for getgrouplist - found
-- Looking for getpeerucred
-- Looking for getpeerucred - not found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for getpwnam_r
-- Looking for getpwnam_r - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for clearenv
-- Looking for clearenv - found
-- Looking for writev
-- Looking for writev - found
-- Looking for setrlimit
-- Looking for setrlimit - found
-- Looking for socketpair
-- Looking for socketpair - found
-- Looking for setlocale
-- Looking for setlocale - found
-- Looking for localeconv
-- Looking for localeconv - found
-- Looking for poll
-- Looking for poll - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for accept4
-- Looking for accept4 - found
-- Looking for inotify_init1
-- Looking for inotify_init1 - found
-- Looking for SCM_RIGHTS
-- Looking for SCM_RIGHTS - found
-- Looking for prctl
-- Looking for prctl - found
-- Looking for raise
-- Looking for raise - found
-- Looking for getrandom
-- Looking for getrandom - found
-- Looking for getrlimit
-- Looking for getrlimit - found
-- Looking for prlimit
-- Looking for prlimit - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for MSG_NOSIGNAL
-- Looking for MSG_NOSIGNAL - found
-- Looking for environ
-- Looking for environ - found
-- Looking for LOG_PERROR
-- Looking for LOG_PERROR - found
-- Performing Test HAVE_CMSGCRED
-- Performing Test HAVE_CMSGCRED - Failed
-- Performing Test DBUS_HAVE_LINUX_EPOLL
-- Performing Test DBUS_HAVE_LINUX_EPOLL - Success
-- Performing Test HAVE_VA_COPY
-- Performing Test HAVE_VA_COPY - Success
-- Performing Test HAVE___VA_COPY
-- Performing Test HAVE___VA_COPY - Success
-- Performing Test DBUS_USE_SYNC
-- Performing Test DBUS_USE_SYNC - Success
-- Performing Test HAVE_DIRFD
-- Performing Test HAVE_DIRFD - Failed
-- Performing Test HAVE_DDFD
-- Performing Test HAVE_DDFD - Failed
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Check size of socklen_t
-- Check size of socklen_t - done
-- effectively used warnings for 'WARNINGS_CFLAGS': all;array-bounds;cast-align;char-subscripts;declaration-after-statement;double-promotion;duplicated-branches;duplicated-cond;extra;float-equal;format-nonliteral;format-security;format=2;implicit-function-declaration;init-self;inline;jump-misses-init;logical-op;missing-declarations;missing-format-attribute;missing-include-dirs;missing-noreturn;missing-prototypes;nested-externs;no-error=missing-field-initializers;no-error=unused-label;no-error=unused-parameter;no-missing-field-initializers;no-unused-label;no-unused-parameter;null-dereference;old-style-definition;packed;pointer-arith;pointer-sign;redundant-decls;restrict;return-type;shadow;sign-compare;strict-aliasing;strict-prototypes;switch-default;switch-enum;undef;unused-but-set-variable;write-strings
-- effectively used disabled warnings for 'WARNINGS_CFLAGS': error=overloaded-virtual;error=missing-field-initializers;error=unused-parameter;unused-parameter
-- effectively used warnings for 'WARNINGS_CXXFLAGS': all;array-bounds;cast-align;char-subscripts;declaration-after-statement;double-promotion;duplicated-branches;duplicated-cond;extra;float-equal;format-nonliteral;format-security;format=2;implicit-function-declaration;init-self;inline;jump-misses-init;logical-op;missing-declarations;missing-format-attribute;missing-include-dirs;missing-noreturn;missing-prototypes;nested-externs;no-error=missing-field-initializers;no-error=unused-label;no-error=unused-parameter;no-missing-field-initializers;no-unused-label;no-unused-parameter;null-dereference;old-style-definition;packed;pointer-arith;pointer-sign;redundant-decls;restrict;return-type;shadow;sign-compare;strict-aliasing;strict-prototypes;switch-default;switch-enum;undef;unused-but-set-variable;write-strings
-- effectively used disabled warnings for 'WARNINGS_CXXFLAGS': error=overloaded-virtual;error=missing-field-initializers;error=unused-parameter;unused-parameter
-- Copying test files to test directory (use -DENABLE_VERBOSE_CONFIG=ON to see the list of files)
-- Generating test files from templates into test directory (use -DENABLE_VERBOSE_CONFIG=ON to see the list of files)
-- Copying generated bus config files to test directory (use -DENABLE_VERBOSE_CONFIG=ON to see the list of files)
-- /nix/store/djd35vxmzdjh2c8yps1dhxl4myqi4726-libxslt-1.1.34-bin/bin/xsltproc found
-- Found DocBookXSL: /nix/store/zl5n86bgfsj6l8p37y2wca4fnixar5v9-docbook-xsl-nons-1.79.2/share/xml/docbook-xsl-nons/
-- xsltproc docbook generator found
set -DDBUS_INSTALL_SYSTEM_LIBS=1 to install runtime libraries too
set DBUSDIR (environment or cmake option) to overwrite the default install directory
D-BUS 1.13.21
=============
install prefix: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20
install exec_prefix: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20
install libdir: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20/lib
install libexecdir: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20/libexec
install bindir: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20/bin
install sysconfdir: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20/etc
install datadir: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20/share
source code location: /build/dbus/..
build dir: /build/dbus/build
c compiler: gcc
cflags: -fno-common -Wall -Warray-bounds -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat=2 -Wimplicit-function-declaration -Winit-self -Winline -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-error=missing-field-initializers -Wno-error=unused-label -Wno-error=unused-parameter -Wno-missing-field-initializers -Wno-unused-label -Wno-unused-parameter -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wrestrict -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-but-set-variable -Wwrite-strings -Wno-error=overloaded-virtual -Wno-error=missing-field-initializers -Wno-error=unused-parameter -Wno-unused-parameter
cflags debug: -g -Wl,--export-dynamic -D_DEBUG
cflags release: -O3 -DNDEBUG
cxx compiler: g++
cxxflags: -fno-common -Wall -Warray-bounds -Wcast-align -Wchar-subscripts -Wdeclaration-after-statement -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wextra -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat=2 -Wimplicit-function-declaration -Winit-self -Winline -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wno-error=missing-field-initializers -Wno-error=unused-label -Wno-error=unused-parameter -Wno-missing-field-initializers -Wno-unused-label -Wno-unused-parameter -Wnull-dereference -Wold-style-definition -Wpacked -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wrestrict -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-but-set-variable -Wwrite-strings -Wno-error=overloaded-virtual -Wno-error=missing-field-initializers -Wno-error=unused-parameter -Wno-unused-parameter
cxxflags debug: -g -Wl,--export-dynamic
cxxflags release: -O3 -DNDEBUG
64-bit int: long
32-bit int: int
16-bit int: short
Doxygen: DOXYGEN-NOTFOUND
Docbook Generator:
gcc coverage profiling: OFF
Building unit tests: ON
Building with GLib:
Building verbose mode: ON
Building w/o assertions: OFF
Building w/o checks: OFF
Building bus stats API: OFF
installing system libs: OFF
Building inotify support: 1
Building kqueue support:
Building systemd support: ON
systemd system install dir:lib/systemd/system
systemd user install dir: lib/systemd/user
Traditional activation: ON
Building Doxygen docs:
Building Qt help docs:
Building XML docs: ON
Daemon executable name: dbus-daemon
System bus address: unix:path=/nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20/var/run/dbus/system_bus_socket
System bus socket:
System bus PID file: /nix/store/00lggmffn31lq5zr1cg4nhmjxac873l4-dbus-1.12.20/var/run/dbus/pid
System bus user: messagebus
Session bus socket dir: /build
pam_console auth dir: (none)
'make check' socket dir: /build
Test listen address: unix:tmpdir=/build
NOTE: building with unit tests increases the size of the installed library and renders it insecure.
NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance.
NOTE: building with assertions increases library size and decreases performance.
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_TESTING
CMAKE_EXPORT_NO_PACKAGE_REGISTRY
CMAKE_POLICY_DEFAULT_CMP0025
-- Build files have been written to: /build/dbus/build
building
build flags: -j8 -l8 SHELL=/nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12/bin/bash
doc/CMakeFiles/dbus-update-activation-environment.1.html.dir/build.make:75: *** missing separator. Stop.
doc/CMakeFiles/dbus-test-plan.html.dir/build.make:75: *** missing separator. Stop.
make[1]: *** [CMakeFiles/Makefile2:2532: doc/CMakeFiles/dbus-update-activation-environment.1.html.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1986: doc/CMakeFiles/dbus-test-plan.html.dir/all] Error 2
doc/CMakeFiles/dbus-tutorial.html.dir/build.make:75: *** missing separator. Stop.
make[1]: *** [CMakeFiles/Makefile2:2012: doc/CMakeFiles/dbus-tutorial.html.dir/all] Error 2
doc/CMakeFiles/dbus-specification.html.dir/build.make:75: *** missing separator. Stop.
make[1]: *** [CMakeFiles/Makefile2:2038: doc/CMakeFiles/dbus-specification.html.dir/all] Error 2
doc/CMakeFiles/dbus-faq.html.dir/build.make:75: *** missing separator. Stop.
make[1]: *** [CMakeFiles/Makefile2:2064: doc/CMakeFiles/dbus-faq.html.dir/all] Error 2
```
similarly with the ninja backend:
```
CMake Error:
Running
'/nix/store/84sc1p2fn4327x08k7qf1avghd55rbr4-ninja-1.10.2/bin/ninja' '-C' '/build/dbus/build' '-t' 'recompact'
failed with:
ninja: warning: phony target 'doc/dbus-cleanup-sockets.1.xml' names itself as an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-daemon.1.xml' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-launch.1.xml' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-monitor.1.xml' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-run-session.1.xml' names itself as
an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-send.1.xml' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-test-tool.1.xml' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-update-activation-environment.1.xml'
names itself as an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-uuidgen.1.xml' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-test-plan.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-tutorial.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-specification.html' names itself as
an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-faq.html' names itself as an input;
ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-daemon.1' names itself as an input;
ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-monitor.1' names itself as an input;
ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-run-session.1' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-send.1' names itself as an input;
ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-test-tool.1' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-launch.1' names itself as an input;
ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-uuidgen.1' names itself as an input;
ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-cleanup-sockets.1' names itself as
an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-update-activation-environment.1'
names itself as an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-daemon.1.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-monitor.1.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-run-session.1.html' names itself as
an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-send.1.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-test-tool.1.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-launch.1.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-uuidgen.1.html' names itself as an
input; ignoring [-w phonycycle=warn]
ninja: warning: phony target 'doc/dbus-cleanup-sockets.1.html' names itself
as an input; ignoring [-w phonycycle=warn]
ninja: warning: phony target
'doc/dbus-update-activation-environment.1.html' names itself as an input;
ignoring [-w phonycycle=warn]
ninja: error: build.ninja:3943: multiple rules generate
doc/dbus-cleanup-sockets.1.xml [-w dupbuild=err]
```https://gitlab.freedesktop.org/dbus/dbus/-/issues/376There is no way of being notified when an activatable service is installed or...2022-02-16T14:08:48ZRastersoftThere is no way of being notified when an activatable service is installed or removedThere is no way for a program to know if a new activatable service has been added or removed to the system, other than periodic polling using `org.freedesktop.DBus.ListActivatableNames()`. A signal that notifies a change in the list of a...There is no way for a program to know if a new activatable service has been added or removed to the system, other than periodic polling using `org.freedesktop.DBus.ListActivatableNames()`. A signal that notifies a change in the list of available activatable services is needed. `org.freedesktop.DBus.NameOwnerChanged` doesn't fulfill this need because it only notifies when a service is activated (and thus its daemon is running) and starts listening, but not when it becomes installed or uninstalled in the system (for example, if the user installs a package in the system and it contains an activatable service).
My use case is for 'Desktop Icons NG' (https://gitlab.com/rastersoft/desktop-icons-ng) or DING. It relies in FileRoller for compressed files management, using its DBus interface to get the list of recognized compressed formats, to uncompress a compressed file, and to compress several files and folders into a single, compressed file. FileRoller registers itself as an activatable service (`org.gnome.ArchiveManager1`), so the binary itself isn't running until it is needed. As an activatable service, it is the DBus daemon the one who launches the file-roller binary if a call for any of its methods is issued by a client and it isn't running.
If FileRoller isn't installed, trying to access it to get the list of available compressed formats will fail because there is no `org.gnome.ArchiveManager1` service registered, so the options for compressing and decompressing files will be set as "disabled" and the user will know that is not possible to manage compressed files. Now, if after noticing this, the user installs the missing 'file-roller' package, the `org.gnome.ArchiveManager1.service` file will be installed in the system and, thus, file-roller will be registered in DBus as an activatable service. But there is no way for DING to be notified of this fact: since file-roller is not launched (because it is an activatable service), `org.freedesktop.DBus.NameOwnerChanged` won't be emitted. So currently, the only options for DING are:
- do nothing, and don't allow the user to compress/decompress until DING is killed and relaunched. This is not a good idea because it forces the user to exit and re-enter the session, thus having to save their current documents.
- use polling, periodically calling `org.freedesktop.DBus.ListActivatableNames()` to check if the activatable service is finally available. Polling is usually a bad idea due to being resource-consuming.
- ask to the DBus daemon the current list of activatable services every time the user does a right-click to show the context menu, parse it, and only then show the menu with the updated status. Since it requires doing an IPC to the daemon and back, it can be considered too slow for an interactive action, and resource-consuming.
- manually monitor (with inotify or kqueue kernel interfaces, or higher-level interfaces like GFileMonitor from GLib) all the folders from `${XDG_DATA}/dbus-1/services`, and if a change is detected, call to `org.freedesktop.DBus.ListActivatableNames()` to get the new list. This is dangerous, because there can be a race condition if DING asks for the list of activatable names before DBus daemon has detected and processed the changes.
For this reason, it would be a good idea to add a new signal to notify to the clients that the current configuration has changed. This change should be quite straightforward, because the DBus daemon is already monitoring the folders where the services are registered, so it would only require to just send a signal at the end of the code that re-reads the configuration after a change.1.14.xhttps://gitlab.freedesktop.org/dbus/dbus/-/issues/375cmake build effectively assumes all platforms are little-endian2022-03-03T11:45:09ZArkanoid87cmake build effectively assumes all platforms are little-endianWhile dealing with ModemManager not starting on OpenWrt device running on big-endian processor, I've confirmed that the Hello message ModemManager sends to dbus-deamon is dropped and connection closed.
Diving into the problem, it seems ...While dealing with ModemManager not starting on OpenWrt device running on big-endian processor, I've confirmed that the Hello message ModemManager sends to dbus-deamon is dropped and connection closed.
Diving into the problem, it seems that `dbus-send` generates malformed Hello messages that `dbus-daemon` accepts it anyway, on the other hand correctly generated Hello messages from ModemManager are dropped by same dbus-daemon.
AFAIK, ModemManager uses glib2 to generate dbus messages.
Please find here details and test buffers:
https://github.com/openwrt/packages/issues/17284#issuecomment-1028573047
Please let me know if you prefer to move attachments here.
Thankshttps://gitlab.freedesktop.org/dbus/dbus/-/issues/374writing oom_score_adj error: Permission denied2022-04-01T17:26:23ZKevin Lockekevin@kevinlocke.namewriting oom_score_adj error: Permission deniedOn Debian testing with `dbus-daemon` 1.12.20 (from `dbus-daemon` package version `1.12.20-3`) the system log contains several:
dbus-daemon[1234]: writing oom_score_adj error: Permission denied
The logs indicate that this occurs dur...On Debian testing with `dbus-daemon` 1.12.20 (from `dbus-daemon` package version `1.12.20-3`) the system log contains several:
dbus-daemon[1234]: writing oom_score_adj error: Permission denied
The logs indicate that this occurs during service activation of services in the user session such as `at-spi2-registryd` for `org.a11y.atspi.Registry`, `mako` for `org.freedesktop.Notifications`, `xfconfd` for `org.xfce.Xfconf`, and `tumbler` for `org.freedesktop.thumbnails.Thumbnailer1` on my system.
It appears that `dbus-daemon` is run at `oom_score_adj` 200 for user sessions when started by systemd v250 and later due to https://github.com/systemd/systemd/pull/20893 . Presumably this prevents the activated service from decreasing `oom_score_adj` due to lacking `CAP_SYS_RESOURCE`.
Since [Bug 32851](https://bugs.freedesktop.org/show_bug.cgi?id=32851), which introduced the OOM score adjustment, appears to be aimed at increasing the score adjustment (from -900 to 0), perhaps it would make sense to skip it when `oom_score_adj` is already <= 0?
Thanks,
Kevin1.14.xhttps://gitlab.freedesktop.org/dbus/dbus/-/issues/373dbus-daemon-launch-helper(?) seems to ignore XDG_DATA_DIRS2022-01-10T20:04:54ZFriedrich W. H. Kossebaudbus-daemon-launch-helper(?) seems to ignore XDG_DATA_DIRSI might have missed something, but here my lines of thoughts and actions:
The [D-Bus specs](https://dbus.freedesktop.org/doc/dbus-specification.html) say:
> On Unix systems, the session bus should search for .service files in $XDG_DATA_...I might have missed something, but here my lines of thoughts and actions:
The [D-Bus specs](https://dbus.freedesktop.org/doc/dbus-specification.html) say:
> On Unix systems, the session bus should search for .service files in $XDG_DATA_DIRS/dbus-1/services.
They also define for the `org.freedesktop.DBus` interface the method `org.freedesktop.DBus.UpdateActivationEnvironment`:
> Normally, session bus activated services inherit the environment of the bus daemon. This method adds to or modifies that environment when activating services.
The method `UpdateActivationEnvironment` is e.g. used by the tool dbus-update-activation-environment if I saw correctly. When using that tool, it confirms me that it has set for the D-Bus session instance the respective value of XDG_DATA_DIRS, which contains the respective `.../share` dir which otherwise also works,
Yet when trying to launch the service/application via the D-Bus service file, the error is "The name org.foo.bar was not provided by any .service files".
If instead the D-Bus service file is placed into the default user's `.local/share/` prefix, the service is launched as expected.
I am not exactly sure if dbus-daemon-launch-helper is involved here (openSUSE Tumbleweed), but it is installed, so possibly used (instead of any newer systemd-based launcher I saw mentioned?). I looked into the code of that tool, and by first glimpse it seems to reset any environment variables and only reads existing config files, and thus initializes the config parser also only with the default values for the 'XDG_*' variables and thus ends only checking & listing service files seen in the user's default `.local/share/` for me (not changed those config files from distro defaults). But I might have been biased by expectations while trying to grasp code behaviour in my head :)
So would there be a bug here (and then in that place) or is this expected hebaviour?
If my expectations from reading the docs are flawed and the method `UpdateActivationEnvironment` is not meant to support this purpose, what other kind of activation should it support?
My general goal is to make more applications DBusActivatable, by tagging that in the desktop files. Which also needs a separate D-Bus service file AFAIK. For the development setup I would like to install only to my user's local paths, to not break the system for other users, and ideally not have to maintain further config files. That works fine otherwise, including integration with the shell, thanks to `XDG_*` variables. But for starting via D-Bus service files, I currently hit a wall and need to find a proper widely acceptable door now :)https://gitlab.freedesktop.org/dbus/dbus/-/issues/372Segfault in `_dbus_marshal_write_basic`2022-03-10T11:53:29ZPaul MenzelSegfault in `_dbus_marshal_write_basic`Using Debian sid/unstable with Linux 5.16-rc8 from the suite *experimental*, *bluez* 5.62-2 and *libdbus-1-3* 1.12.20-3, connecting to a Google Nest over Bluetooth, bluetoothd crashed with a segmentation fault:
[ 7793.540822] blueto...Using Debian sid/unstable with Linux 5.16-rc8 from the suite *experimental*, *bluez* 5.62-2 and *libdbus-1-3* 1.12.20-3, connecting to a Google Nest over Bluetooth, bluetoothd crashed with a segmentation fault:
[ 7793.540822] bluetoothd[7937]: segfault at 3 ip 00007f73196e3d28 sp 00007fffbd269280 error 4 in libdbus-1.so.3.19.13[7f73196be000+2f000]
[ 7793.540835] Code: 08 4c 89 e9 44 89 e2 53 41 b9 6c 00 00 00 41 89 c0 48 89 ee bf 01 00 00 00 e8 e4 f9 ff ff 5a 59 e9 9f fe ff ff 0f 1f 44 00 00 <0f> b6 16 44 89 e6 e8 fd be fd ff 85 c0 0f 84 87 fe ff ff b8 01 00
```
(gdb) bt
#0 _dbus_marshal_write_basic (str=0x55992b2dc560, insert_at=213, type=type@entry=121, value=value@entry=0x3, byte_order=108, pos_after=pos_after@entry=0x7fffbd2693e0) at ../../../dbus/dbus-marshal-basic.c:814
#1 0x00007f73196cef9b in _dbus_type_writer_write_basic_no_typecode (value=0x3, type=121, writer=0x7fffbd2693c0) at ../../../dbus/dbus-marshal-recursive.c:1605
#2 _dbus_type_writer_write_basic_no_typecode (value=0x3, type=121, writer=0x7fffbd2693c0) at ../../../dbus/dbus-marshal-recursive.c:1600
#3 _dbus_type_writer_write_basic (writer=writer@entry=0x7fffbd2693c0, type=type@entry=121, value=value@entry=0x3) at ../../../dbus/dbus-marshal-recursive.c:2327
#4 0x00007f73196d36b8 in dbus_message_iter_append_basic (iter=iter@entry=0x7fffbd2693b0, type=type@entry=121, value=0x3) at ../../../dbus/dbus-message.c:2843
#5 0x0000559929aba78e in get_codec (property=<optimized out>, iter=0x7fffbd2693b0, data=<optimized out>) at profiles/audio/a2dp.c:1970
#6 0x0000559929b54f86 in append_property (iface=iface@entry=0x55992b2fbdd0, p=p@entry=0x559929bd6830 <sep_properties+48>, dict=dict@entry=0x7fffbd269430) at gdbus/object.c:498
#7 0x0000559929b55632 in append_properties (data=data@entry=0x55992b2fbdd0, iter=iter@entry=0x7fffbd2694b0) at gdbus/object.c:527
#8 0x0000559929b556bf in append_interface (data=0x55992b2fbdd0, user_data=0x7fffbd269590) at gdbus/object.c:542
#9 0x00007f7319778938 in g_slist_foreach (list=<optimized out>, func=func@entry=0x559929b55670 <append_interface>, user_data=user_data@entry=0x7fffbd269590) at ../../../glib/gslist.c:885
#10 0x0000559929b557c9 in emit_interfaces_added (data=0x55992b31f310) at gdbus/object.c:574
#11 process_changes (user_data=0x55992b31f310) at gdbus/object.c:996
#12 0x0000559929b56fb7 in g_dbus_flush (connection=0x55992b2d57d0) at gdbus/object.c:1494
#13 g_dbus_send_message (message=0x55992b2fbe10, connection=0x55992b2d57d0) at gdbus/object.c:1518
#14 g_dbus_send_message (connection=0x55992b2d57d0, message=0x55992b2fbe10) at gdbus/object.c:1498
#15 0x0000559929b39d87 in device_profile_connected (err=-5, profile=0x559929be0440 <a2dp_source_profile>, dev=0x55992b301360) at src/device.c:1802
#16 service_state_changed (service=<optimized out>, old_state=<optimized out>, new_state=<optimized out>, user_data=<optimized out>) at src/device.c:7002
#17 0x0000559929b2d072 in change_state (service=0x55992b306bd0, state=BTD_SERVICE_STATE_DISCONNECTED, err=<optimized out>) at src/service.c:98
#18 0x0000559929ab91ef in discovery_complete (session=<optimized out>, seps=<optimized out>, err=-5, user_data=0x55992b305b70) at profiles/audio/source.c:237
#19 0x0000559929abdd87 in finalize_discover (s=0x55992b301250) at profiles/audio/a2dp.c:403
#20 discover_cb (session=<optimized out>, seps=<optimized out>, err=<optimized out>, user_data=0x55992b301250) at profiles/audio/a2dp.c:2842
#21 0x0000559929ac0ba7 in finalize_discovery (session=0x55992b311700, err=0) at profiles/audio/avdtp.c:1087
#22 0x0000559929ac63e0 in avdtp_parse_resp (transaction=<optimized out>, size=16, buf=0x55992b311773, signal_id=<optimized out>, stream=0x0, session=0x55992b311700) at profiles/audio/avdtp.c:2957
#23 session_cb (data=0x55992b311700, cond=<optimized out>, chan=<optimized out>) at profiles/audio/avdtp.c:2284
#24 session_cb (chan=<optimized out>, cond=<optimized out>, data=0x55992b311700) at profiles/audio/avdtp.c:2208
#25 0x00007f7319758be4 in g_main_dispatch (context=0x55992b2d05b0) at ../../../glib/gmain.c:3381
#26 g_main_context_dispatch (context=0x55992b2d05b0) at ../../../glib/gmain.c:4099
#27 0x00007f7319758f88 in g_main_context_iterate (context=0x55992b2d05b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4175
#28 0x00007f7319759273 in g_main_loop_run (loop=0x55992b2d1790) at ../../../glib/gmain.c:4373
#29 0x0000559929b6ccd5 in mainloop_run () at src/shared/mainloop-glib.c:66
#30 0x0000559929b6d12c in mainloop_run_with_signal (func=func@entry=0x559929afe2c0 <signal_callback>, user_data=user_data@entry=0x0) at src/shared/mainloop-notify.c:188
#31 0x0000559929ab142d in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:1210
```
* [Full backtrace of all threads `t a a bt f`](/uploads/d2aa0154bbfae475f1e7f2835c7845aa/bluetoothd-sigsegv-gdb-taabtf.txt)https://gitlab.freedesktop.org/dbus/dbus/-/issues/370Multiple implementation of thread locks in Windows code2022-05-17T23:24:29ZRalf HabackerMultiple implementation of thread locks in Windows code
In the dbus Windows code there is
```
_dbus_win_startup_winsock (void)
{
...
if (!_DBUS_LOCK (sysdeps))
return FALSE;
...
```
and for example
```c
dbus_bool_t
_dbus_daemon_is_session_bus_address_published()
...
lock = _dbus_glob...
In the dbus Windows code there is
```
_dbus_win_startup_winsock (void)
{
...
if (!_DBUS_LOCK (sysdeps))
return FALSE;
...
```
and for example
```c
dbus_bool_t
_dbus_daemon_is_session_bus_address_published()
...
lock = _dbus_global_lock (...);
...
```
Looking at the two implementations, it turned out that DBUS_LOCK() uses _dbus_lock(), which is based on _dbus_platform_rmutex_lock(), which uses WaitForSingleObject(). _dbus_global_lock() also uses WaitForSingleObject().
The main differences are that _dbus_global_lock() creates a named mutex for sharing the mutex between processes, uses a different return type and evaluates the results of WaitForSingleObject somehow.
I propose to integrate _dbus_global_lock()/_dbus_global_unlock() into the current _dbus_platform_rmutex_xxx functions, adjust the implementation (including #369), create a new function for generating the named mutex e.g. `_dbus_platform_rmutex_named_new (const char* name)` as:
```
DBusRMutex *
_dbus_platform_rmutex_named_new (const char* name)
{
HANDLE handle;
handle = CreateMutex (NULL, FALSE, name);
return (DBusRMutex *) handle;
}
```
and use that (and related) functions in the autolaunch related Windows code, to reduce this code duplication and future maintenance overhead.https://gitlab.freedesktop.org/dbus/dbus/-/issues/369Windows implementation of _dbus_platform_rmutex_lock() does not match the exp...2022-05-05T14:20:41ZRalf HabackerWindows implementation of _dbus_platform_rmutex_lock() does not match the expectations of the client codeThe unix variant of _dbus_platform_rmutex_lock() is implemented as
```
void
_dbus_platform_rmutex_lock (DBusRMutex *mutex)
{
PTHREAD_CHECK ("pthread_mutex_lock", pthread_mutex_lock (&mutex->lock));
}
```
It asserts in any error case a...The unix variant of _dbus_platform_rmutex_lock() is implemented as
```
void
_dbus_platform_rmutex_lock (DBusRMutex *mutex)
{
PTHREAD_CHECK ("pthread_mutex_lock", pthread_mutex_lock (&mutex->lock));
}
```
It asserts in any error case and let client code simple use
```
_dbus_platform_rmutex_lock (mutex)
/* protected access */
_dbus_platform_rmutex_unlock (mutex)
```
This behavior is not not implemented in the Windows code:
```
void
_dbus_platform_rmutex_lock (DBusRMutex *mutex)
{
WaitForSingleObject ((HANDLE *) mutex, INFINITE);
}
```
which can lead to threading problems, such as those reported at https://gitlab.freedesktop.org/dbus/dbus/-/issues/368.https://gitlab.freedesktop.org/dbus/dbus/-/issues/368Invalid uses of _dbus_global_lock() in windows related code2022-05-17T23:24:29ZRalf HabackerInvalid uses of _dbus_global_lock() in windows related codeIn the Windows-related dbus source code, there are several calls to _dbus_global_lock() in the form
```
mutex = _dbus_global_lock (cDBusAutolaunchMutex);
...
_dbus_global_unlock (&mutex);
```
which will fail due to the implementat...In the Windows-related dbus source code, there are several calls to _dbus_global_lock() in the form
```
mutex = _dbus_global_lock (cDBusAutolaunchMutex);
...
_dbus_global_unlock (&mutex);
```
which will fail due to the implementation of the listed function if access to the returned mutex fails.https://gitlab.freedesktop.org/dbus/dbus/-/issues/366Incorrect output from test-bus-dispatch --list-tests2021-12-15T18:24:11ZRalf HabackerIncorrect output from test-bus-dispatch --list-testsRunning the mentioned test case compiled from recent master gives the following partial incorrect output:
```
bin/test-bus-dispatch --list-tests
dispatch
org.freedesktop.DBus
<signal name="NameOwnerChanged">
<arg type="s"/>
...Running the mentioned test case compiled from recent master gives the following partial incorrect output:
```
bin/test-bus-dispatch --list-tests
dispatch
org.freedesktop.DBus
<signal name="NameOwnerChanged">
<arg type="s"/>
<arg type="s"/>
<arg type="s"/>
</signal>
<signal name="NameLost">
<arg type="s"/>
</signal>
<signal name="NameAcquired">
<arg type="s"/>
</signal>
@
E
�
E
Speicherzugriffsfehler (Speicherabzug geschrieben)
```https://gitlab.freedesktop.org/dbus/dbus/-/issues/365memory leaks in _dbus_get_install_root_as_hash in case of OOM condition2021-12-17T08:03:48ZRalf Habackermemory leaks in _dbus_get_install_root_as_hash in case of OOM conditionThe mentioned [function](https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/dbus/dbus-sysdeps-win.c#L2938) contains memory leaks as shown below:
```c
static dbus_bool_t
_dbus_get_install_root_as_hash(DBusString *out)
{
DBusStrin...The mentioned [function](https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/dbus/dbus-sysdeps-win.c#L2938) contains memory leaks as shown below:
```c
static dbus_bool_t
_dbus_get_install_root_as_hash(DBusString *out)
{
DBusString install_path;
_dbus_string_init(&install_path);
```
-> no oom check here
```
if (!_dbus_get_install_root (&install_path) ||
_dbus_string_get_length (&install_path) == 0)
return FALSE;
```
-> `install_path` is not free'd in case of errors.
```
_dbus_string_init(out);
```
-> no oom check here
```
_dbus_string_tolower_ascii(&install_path,0,_dbus_string_get_length(&install_path));
if (!_dbus_sha_compute (&install_path, out))
return FALSE;
```
-> `install_path` and `out` are not free'd in case of errors.https://gitlab.freedesktop.org/dbus/dbus/-/issues/363Confusing output of the number of tests performed2021-12-16T08:01:54ZRalf HabackerConfusing output of the number of tests performedWhen selecting a single test in the dbus test programs, the complete number of tests is still output which is confusing.
How to reproduce
----------------
1. build dbus
2. enter build dir
3. run `test-bus test/data signals`
The output ...When selecting a single test in the dbus test programs, the complete number of tests is still output which is confusing.
How to reproduce
----------------
1. build dbus
2. enter build dir
3. run `test-bus test/data signals`
The output is
```
# Test data in test/data
ok 2 # SKIP expire-list - Only intending to run signals
ok 3 # SKIP config-parser - Only intending to run signals
# Running test: signals
ok 4 - signals
# signals test took 1 seconds
ok 5 - signals did not leak memory
ok 6 # SKIP activation-service-reload - Only intending to run signals
ok 7 # SKIP unix-fds-passing - Only intending to run signals
# 7 tests passed
1..7
```
In particular, the message `# 7 tests passed` is not really true. I think it should read
```
# Test data in test/data
ok 1 - initial nss query did not leak memory
# Running test: signals
ok 2 - signals
# signals test took 1 seconds
ok 3 - signals did not leak memory
# 3 tests passed
1..3
```https://gitlab.freedesktop.org/dbus/dbus/-/issues/362Test applications do not display invalid test selection2021-12-10T12:46:13ZRalf HabackerTest applications do not display invalid test selectionOn https://gitlab.freedesktop.org/dbus/dbus/-/issues/360#note_1183092 you can see that an invalid name was used for a specific test, but the test application did not complain about this, which can lead to unexpected test results and shou...On https://gitlab.freedesktop.org/dbus/dbus/-/issues/360#note_1183092 you can see that an invalid name was used for a specific test, but the test application did not complain about this, which can lead to unexpected test results and should be corrected.https://gitlab.freedesktop.org/dbus/dbus/-/issues/361Running test-bus on Linux fails with 'dbus-daemon - Cannot initialize inotify'2022-09-08T17:55:49ZRalf HabackerRunning test-bus on Linux fails with 'dbus-daemon - Cannot initialize inotify'To see if the problem reported at https://gitlab.freedesktop.org/dbus/dbus/-/issues/360 was related to the cmake build system, the same test was compiled and run on Linux (openSUSE 15.2, gcc 7.5)
```
mkdir ~/src
cd ~/src
git clone https:...To see if the problem reported at https://gitlab.freedesktop.org/dbus/dbus/-/issues/360 was related to the cmake build system, the same test was compiled and run on Linux (openSUSE 15.2, gcc 7.5)
```
mkdir ~/src
cd ~/src
git clone https://gitlab.freedesktop.org/dbus/dbus.git
mkdir build-cmake
cd build-cmake
cmake ../dbus
make
ctest -R test-bus$ -VV
```
The following error occurred:
```
9: ok 6 - signals
9: # signals test took 1 seconds
9: ok 7 - signals did not leak memory
9: # Running test: activation-service-reload
9: dbus-daemon[28279]: Cannot initialize inotify
9: /home/xxx/src/dbus-cmake-build/lib/libdbus-1.so.3(_dbus_print_backtrace+0x1f) [0x7f0da73252cf]
9: /home/xxx/src/dbus-cmake-build/lib/libdbus-1.so.3(_dbus_abort+0xd) [0x7f0da731e2c9]
9: /home/xxx/src/dbus-cmake-build/lib/libdbus-1.so.3(_dbus_warn+0xf2) [0x7f0da730c292]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus() [0x441fcf]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus(bus_set_watched_dirs+0x1c) [0x442100]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus() [0x416976]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus(bus_context_new+0x7b6) [0x41713f]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus(bus_context_new_test+0x107) [0x441886]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus() [0x415235]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus(bus_activation_service_reload_test+0xdd) [0x41551d]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus(_dbus_test_main+0x252) [0x443155]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus(main+0x3c) [0x41050a]
9: /lib64/libc.so.6(__libc_start_main+0xea) [0x7f0da685534a]
9: /home/xxx/src/dbus-cmake-build/bin/test-bus(_start+0x2a) [0x4103fa]
```
[error.log](/uploads/ecf91023840e2edd8a6205b989d6e512/error.log)
In the case of a temporary problem caused by too many open files, the message can be reproduced by a previous call to `sudo sh -c "echo 0 > /proc/sys/fs/inotify/max_user_instances"`, but this returns `-1` as the return value of `inotify_initx()` rather than the `0` value under discussion.
A different approach to reproduce is to run:
```
$ gdb --args bin/test-bus test/data
(gdb) b dir-watch-inotify.c:225
r
Breakpoint 1, _init_inotify (context=0x6824c0) at /home/ralf.habacker/src/dbus/bus/dir-watch-inotify.c:225
225 if (inotify_fd == -1)
(gdb) call (int)close(0)
$1 = 0
(gdb) c
dbus-daemon[9502]: Cannot initialize inotify
Breakpoint 1, _init_inotify (context=0x683880) at /home/ralf.habacker/src/dbus/bus/dir-watch-inotify.c:225
225 if (inotify_fd == -1)
(gdb) p inotify_fd
$3 = 0
```
The same behavior can be reproduced with `dbus-daemon`.
The problem with the message ` dbus-daemon[11508]: Cannot initialize inotify: Too many open files` also occurred after a package update of the Linux system (openSUSE Leap) that required a reboot, but the reboot had not yet been performed.https://gitlab.freedesktop.org/dbus/dbus/-/issues/360activation-service-reload in test-bus still fails with memory leaks on Windows2021-12-10T07:56:58ZRalf Habackeractivation-service-reload in test-bus still fails with memory leaks on WindowsRunning test-bus from a gcc cmake build for Windows from recent master with
```
set DBUS_TEST_TIMEOUT_MULTIPLIER=2
ctest -R test-bus$ --output-on-failure --timeout 180
```
fails on a local machine with the following error:
```
9: ok 8...Running test-bus from a gcc cmake build for Windows from recent master with
```
set DBUS_TEST_TIMEOUT_MULTIPLIER=2
ctest -R test-bus$ --output-on-failure --timeout 180
```
fails on a local machine with the following error:
```
9: ok 8 - activation-service-reload
9: # activation-service-reload test took 3 seconds
9: not ok 9 - activation-service-reload leaked 18 blocks
9: # Running test: unix-fds-passing
9: ok 10 # SKIP fd-passing not supported on this platform
9: ok 11 - unix-fds-passing
9: # unix-fds-passing test took 0 seconds
9: not ok 12 - unix-fds-passing leaked 18 blocks
9: # 2/12 tests failed
9: 1..12
1/1 Test #9: test-bus .........................***Failed 8.09 sec
```
The error happens regardless if running on a native host or with the help of wine.
The whole log file generated by this test has been appended [error.log](/uploads/0d25ec2ff46ee472664e93bad70ebd19/error.log)https://gitlab.freedesktop.org/dbus/dbus/-/issues/359test-dbus-daemon fails on CI with x86_64-w64-mingw32 builds2021-12-07T13:07:31ZRalf Habackertest-dbus-daemon fails on CI with x86_64-w64-mingw32 buildshttps://gitlab.freedesktop.org/dbus/dbus/-/jobs/16445975 show the following error:
```
14: # max perf: 10000 messages / 67.441041 seconds
14: # Time since timeout reset 000000000072eec0: 67.705 seconds
14: Bail out! Test timed out (GLib ...https://gitlab.freedesktop.org/dbus/dbus/-/jobs/16445975 show the following error:
```
14: # max perf: 10000 messages / 67.441041 seconds
14: # Time since timeout reset 000000000072eec0: 67.705 seconds
14: Bail out! Test timed out (GLib main loop timeout callback reached)
14/34 Test #14: test-dbus-daemon .................***Failed 81.88 sec
```https://gitlab.freedesktop.org/dbus/dbus/-/issues/357test-spawn-oom fails on Windows with memory checking enabled2021-12-06T13:02:32ZRalf Habackertest-spawn-oom fails on Windows with memory checking enabledRunning test-spawn-oom with memory checking enabled on Windows fails with the following errors:
```
dbus[32]: error: Not expecting error when launching segfaulting executable: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to spawn ...Running test-spawn-oom with memory checking enabled on Windows fails with the following errors:
```
dbus[32]: error: Not expecting error when launching segfaulting executable: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to spawn child
```
How to reproduce
----------------
In dbus/dbus-memory.c change the mentioned location below, then compile and run test-spawn-oom
```
dbus_bool_t
_dbus_decrement_fail_alloc_counter (void)
{
_dbus_initialize_malloc_debug ();
-#ifdef DBUS_WIN
+#ifdef _DBUS_WIN
```
Additional information
----------------------
With !223 the new error name has been introduced and needs to be added to this test as expected error.https://gitlab.freedesktop.org/dbus/dbus/-/issues/356When building with the CMake build system, a compiler warning configuration d...2021-12-10T14:16:40ZRalf HabackerWhen building with the CMake build system, a compiler warning configuration different from autotools is usedThis leads to hidden problems, such as those reported at https://gitlab.freedesktop.org/dbus/dbus/-/issues/355, and should be corrected.This leads to hidden problems, such as those reported at https://gitlab.freedesktop.org/dbus/dbus/-/issues/355, and should be corrected.https://gitlab.freedesktop.org/dbus/dbus/-/issues/355build error: cast between incompatible function types from 'FARPROC'2021-11-30T09:31:50ZRalf Habackerbuild error: cast between incompatible function types from 'FARPROC'While trying to reproduce the issue reported at #353 with a local docker build with autotools, it fails with
```
../../dbus/dbus-sysdeps-win.c: In function 'load_ex_ip_helper_procedures':
../../dbus/dbus-sysdeps-win.c:129:43: error: cast...While trying to reproduce the issue reported at #353 with a local docker build with autotools, it fails with
```
../../dbus/dbus-sysdeps-win.c: In function 'load_ex_ip_helper_procedures':
../../dbus/dbus-sysdeps-win.c:129:43: error: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'DWORD (*)(struct _MIB_TCPTABLE_OWNER_PID **, BOOL, void *, DWORD, DWORD)' {aka 'long unsigned int (*)(struct _MIB_TCPTABLE_OWNER_PID **, int, void *, long unsigned int, long unsigned int)'} [-Werror=cast-function-type]
lpfnAllocateAndGetTcpExTableFromStack = (ProcAllocateAndGetTcpExtTableFromStack)GetProcAddress (hModule, "AllocateAndGetTcpExTableFromStack");
^
```
I wonder why this does not occur on gitlab CI, since it uses the same docker image and packages.
The build steps performed, which are the same as those performed on Gitlab CI, are:
```
sudo docker pull debian:buster-slim
sudo docker run -v $PWD:/mnt -it debian:buster-slim /bin/bash
cd mnt
ci_buildsys=autotools ci_distro=debian ci_docker= ci_in_docker=yes ci_host=x86_64-w64-mingw32 ci_local_packages=yes ci_suite=buster ci_variant=debug ./tools/ci-install.sh
ci_buildsys=autotools ci_distro=debian ci_docker= ci_host=x86_64-w64-mingw32 ci_local_packages=yes ci_parallel=2 ci_suite=buster ci_test=yes ci_test_fatal=yes ci_variant=debug ci_runtime=static ./tools/ci-build.sh
```https://gitlab.freedesktop.org/dbus/dbus/-/issues/354If dbus-daemon fails to start up, Windows dbus-run-session does not detect it2021-11-25T15:55:43ZSimon McVittieIf dbus-daemon fails to start up, Windows dbus-run-session does not detect it## Steps to reproduce
Seen in for example https://gitlab.freedesktop.org/rhabacker/dbus/-/jobs/16153796 due to #353. Could be replicated by altering the dbus-daemon to `exit(1)` during startup (before the `--ready-event-handle` is signa...## Steps to reproduce
Seen in for example https://gitlab.freedesktop.org/rhabacker/dbus/-/jobs/16153796 due to #353. Could be replicated by altering the dbus-daemon to `exit(1)` during startup (before the `--ready-event-handle` is signalled), or by replacing it with an older dbus-daemon that does not implement the `--ready-event-handle` option.
## Expected result
If the dbus-daemon fails before the `--ready-event-handle` is signalled, then `dbus-run-session` should detect that, and exit unsuccessfully.
## Actual result
`dbus-run-session` does not exit until the 30 second timeout for `_dbus_win_event_wait()` has elapsed.