Comment 10 for bug 913991

Revision history for this message
In , Jason Conti (jconti) wrote :

Think I found the offending code in dbus/dbus-spawn.c:do_exec

 953 #ifdef DBUS_BUILD_TESTS
 954 max_open = sysconf (_SC_OPEN_MAX);
 955
 956 for (i = 3; i < max_open; i++)
 957 {
 958 int retval;
 959
 960 if (i == child_err_report_fd)
 961 continue;
 962
 963 retval = fcntl (i, F_GETFD);
 964
 965 if (retval != -1 && !(retval & FD_CLOEXEC))
 966 _dbus_warn ("Fd %d did not have the close-on-exec flag set!\n", i);
 967 }
 968 #endif

It doesn't seem like this code should get executed since it seems to be disabled in the non-debug package build, but commenting it out and rebuilding the package on precise and I can't reproduce the aborts.

It also seems like quite a few processes are leaking file descriptors. Running your first dbus-daemon example in the last comment under gdb will also cause the abort unless I manually set FD_CLOEXEC on fd 3-6 before attempting to launch the service. Likewise, running dbus-daemon with --fork will trigger the aborts.