d-bus head

David Zeuthen david@fubar.dk
Thu, 30 Oct 2003 21:21:34 +0100


--=-L6WlKh1FeyXxeZuKvesm
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Wed, 2003-10-29 at 17:10, Joe Shaw wrote:
> When I first did the port of d-bus to darwin I reimplemented poll()
> using select() because OS X prior to 10.3 didn't have it.  I didn't know
> about libpoll at the time (in Fink), so maybe it's a bug in the
> implementation.  Linking against libpoll might fix things.

Linking against libpoll does solve this bug. Ok to commit the one-liner
attached? (I've also tested it on a Linux x86 system).

Now another bug emerges: when running dbus-monitor --system I get
"Disconnected prior to receiving a reply", see output from dbus-daemon-1
in [1]. Is this a known issue or something that should be fixed? If so,
I'd like to volunteer if someone can give me some pointers...

Thanks,
David

[1] :
[powerbook:~] root# rm -f /usr/local/var/run/dbus/pid
[powerbook:~] root# /usr/local/bin/dbus-daemon-1 --system --print-pid
1463: Allocated slot 0 on allocator 0x7291c total 1 slots allocated 1
used
1463: listening on unix socket /usr/local/var/run/dbus/system_bus_socket
abstract=0
1463: Initialized server on address
unix:path=/usr/local/var/run/dbus/system_bus_socket
1463: Adding a watch on fd 3 using newly-set add watch function
1463: Allocated slot 0 on allocator 0x728ac total 1 slots allocated 1
used
1463
1463: We are on D-Bus...
1463: Running main loop, depth 0 -> 1
1463: Handling client connection, flags 0x1
1463: Creating new client connection with fd 4
1463: Adding a watch on fd 4 using newly-set add watch function
1463: Adding a watch on fd 4 using newly-set add watch function
1463: Connection 0x1fec60 authentication expires in 29994 milliseconds
1463: Enabled expire timeout with interval 29994
1463: handling read watch
1463: read credentials byte
1463: Socket credentials not supported on this OS
1463: Credentials:  pid 4294967295  uid 4294967295  gid 4294967295
1463:  server auth state: waiting for input
1463:  read 20 bytes in auth phase
1463: server: got command "AUTH EXTERNAL Aw=="
1463: server: Processing auth command AUTH
1463: server: Trying mechanism EXTERNAL with initial response of 1 bytes
1463: server: no credentials, mechanism EXTERNAL can't authenticate
1463: server: Shutting down mechanism EXTERNAL
1463:  server auth state: bytes to send
1463:  server auth state: bytes to send
1463: server: Sent 36 bytes of: REJECTED EXTERNAL DBUS_COOKIE_SHA1
                                                                                
1463:  server auth state: waiting for input
1463: Not authenticated, not writing anything
1463: handling read watch
1463:  server auth state: waiting for input
1463:  read 20 bytes in auth phase
1463: server: got command "AUTH EXTERNAL Aw=="
1463: server: Processing auth command AUTH
1463: server: Trying mechanism EXTERNAL with initial response of 1 bytes
1463: server: no credentials, mechanism EXTERNAL can't authenticate
1463: server: Shutting down mechanism EXTERNAL
1463:  server auth state: bytes to send
1463:  server auth state: bytes to send
1463: server: Sent 36 bytes of: REJECTED EXTERNAL DBUS_COOKIE_SHA1
 
1463:  server auth state: waiting for input
1463: Not authenticated, not writing anything
1463: handling read watch
1463:  server auth state: waiting for input
1463: Disconnected from remote app
1463: Removing watch on fd 4
1463: Removing watch on fd 4
1463: Setting watch fd -1 data to data = 0x0 function = 0x0 from data =
0x0 function = 0x0
1463: Setting watch fd -1 data to data = 0x0 function = 0x0 from data =
0x0 function = 0x0
1463: Synthesized message 0x1fecf0 added to incoming queue 0x1fec60, 1
incoming
1463: Notifying of change to dispatch status of 0x1fec60 now 0 (data
remains)
1463: Message 0x1fecf0 (4 org.freedesktop.Local '') removed from
incoming queue
0x1fec60, 0 incoming
1463:   running filter on message 0x1fecf0
1463: set_string_field() field 4 prealloc 49
1463: header field didn't exist, no need to delete
1463: set_string_field() field 6 prealloc 14
1463: header field didn't exist, no need to delete
1463: set_string_field() field 7 prealloc 34
1463: header field didn't exist, no need to delete
1463: DISPATCH: org.freedesktop.Local Disconnected (no error name) to
peer
1463: (inactive) disconnected, dropping all service ownership and
releasing
1463: Removing all pre-existing watches
1463: Dropping pending replies that involve connection 0x1fec60
1463: Done with message in dbus_connection_dispatch
1463: Finalizing connection 0x1fec60
1463: Running expire_incomplete_timeout
1463: Disabled expire timeout



--=-L6WlKh1FeyXxeZuKvesm
Content-Disposition: attachment; filename=dbus-use-libpoll.patch
Content-Type: text/x-patch; name=dbus-use-libpoll.patch; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Index: configure.in
===================================================================
RCS file: /cvs/dbus/dbus/configure.in,v
retrieving revision 1.75
diff -u -r1.75 configure.in
--- configure.in	21 Oct 2003 05:46:51 -0000	1.75
+++ configure.in	30 Oct 2003 20:08:13 -0000
@@ -323,6 +323,9 @@
 AC_CHECK_LIB(socket,socket)
 AC_CHECK_LIB(nsl,gethostbyname)
 
+#### Use libpoll on e.g. Mac OS X pre-10.3
+AC_CHECK_LIB(poll, poll, [LIBS="$LIBS -lpoll" ac_cv_func_poll_lpoll=yes], ac_cv_func_poll_lpoll=no)
+
 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
 
 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])

--=-L6WlKh1FeyXxeZuKvesm--