Disconnection caused by byte order problem (DBUS_INVALID_BAD_BYTE_ORDER)

No-Joon Park nojoon at gmail.com
Wed Aug 13 23:00:30 PDT 2008


I'm calling dbus_connection_send_with_reply_and_block() for
communicating dbus-daemon.
But occasionally the connection is disconnected.
By tracing the dbus library source code, I found that there is a
problem of byte order. (DBUS_INVALID_BAD_BYTE_ORDER)

I don't know what to do about this disconnection caused by byte order problem.

Any suggestions?


The following is the back trace.

The byte_order in _dbus_header_have_message_untrusted() must be
DBUS_LITTLE_ENDIAN(108) or DBUS_BIG_ENDIAN(66), but my byte_order
occasionally is zero, which causes the disconnection.

Breakpoint 1, _dbus_header_have_message_untrusted
(max_message_length=134217728, validity=0xbfc6df08,
    byte_order=0xbfc6df04, fields_array_len=0xbfc6df00,
header_len=0xbfc6defc, body_len=0xbfc6def8, str=0x8e07b7c,
    start=0, len=2048) at dbus-marshal-header.c:681
681           *validity = DBUS_INVALID_BAD_BYTE_ORDER;
(gdb) p *str
$1 = {dummy1 = 0x8e08a00, dummy2 = 0, dummy3 = 2056, dummy4 =
2147483639, dummy5 = 0, dummy6 = 0, dummy7 = 0, dummy8 = 0}
(gdb) bt
#0  _dbus_header_have_message_untrusted (max_message_length=134217728,
validity=0xbfc6df08, byte_order=0xbfc6df04,
    fields_array_len=0xbfc6df00, header_len=0xbfc6defc,
body_len=0xbfc6def8, str=0x8e07b7c, start=0, len=2048)
    at dbus-marshal-header.c:681
#1  0xb75c80d4 in _dbus_message_loader_queue_messages
(loader=0x8e07b78) at dbus-message.c:3606
#2  0xb75d1502 in _dbus_transport_get_dispatch_status
(transport=0x8e07aa0, conn=0x8e07ea8)
    at dbus-transport.c:1110
#3  0xb75b702d in _dbus_connection_get_dispatch_status_unlocked
(connection=0x8e07ea8) at dbus-connection.c:4110
#4  0xb75b3e3b in check_for_reply_and_update_dispatch_unlocked
(connection=0x8e07ea8, pending=0x8da9e98)
    at dbus-connection.c:2266
#5  0xb75b4201 in _dbus_connection_block_pending_call
(pending=0x8da9e98) at dbus-connection.c:2395
#6  0xb75ca7cb in dbus_pending_call_block (pending=0x8da9e98) at
dbus-pending-call.c:707
#7  0xb75b5e5f in dbus_connection_send_with_reply_and_block
(connection=0x8e07ea8, message=0x8e0c880,
    timeout_milliseconds=-1, error=0xbfc6e104) at dbus-connection.c:3422


More information about the dbus mailing list