Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

dbus: wire format error: invalid value for boolean #377

Open
raas opened this issue Nov 29, 2023 · 1 comment
Open

dbus: wire format error: invalid value for boolean #377

raas opened this issue Nov 29, 2023 · 1 comment

Comments

@raas
Copy link

raas commented Nov 29, 2023

Hi,

I get the above after trying to EncodeTo() then DecodeMessage() on notification messages originating from Google Calendar or Telegram in Firefox -- messages that are fairly large and stuffed with... stuff in the hints field. Attached is a binary format of this (as produced by msg.EncodeTo(&b, binary.LittleEndian)).

broken-message.gz

Everything else I found so far works fine, even other messages that use the hints field. I could not create a reproducer with simple dbus-send.

Code I try to read the data with:

  b, err := os.ReadFile(os.Args[1])
  // 
  r := bytes.NewReader(b)
  msg, err := dbus.DecodeMessage(r)

  if err != nil {
    log.Fatalf("dbus.DecodeMessage: %v", err)
  }

Help? How can I debug this further? dbus itself and various notification daemons seem happy with the message.

@raas
Copy link
Author

raas commented Dec 30, 2024

The bug is in the encoder, not the decoder. I ran dbus-monitor --binary to obtain a sample, and that can be decoded fine by godbus. Said sample attached.

dbus-calendar.bin.log

weird wrong snippet (generated by msg.Encode()):

00000150  0a 00 00 00 69 6d 61 67  65 2d 64 61 74 61 00 0a  |....image-data..|
00000160  28 69 69 69 62 69 69 61  79 29 00 00 38 41 04 00  |(iiibiiay)..8A..|
00000170  01 69 00 00 08 01 00 00  01 69 00 00 08 01 00 00  |.i.......i......|
00000180  01 69 00 00 20 04 00 00  01 62 00 00 01 00 00 00  |.i.. ....b......|
00000190  01 69 00 00 08 00 00 00  01 69 00 00 04 00 00 00  |.i.......i......|

Good snippet (from the dbus-monitor dump):

000002a0  00 00 00 00 00 00 0a 00  00 00 69 6d 61 67 65 2d  |..........image-|
000002b0  64 61 74 61 00 0a 28 69  69 69 62 69 69 61 79 29  |data..(iiibiiay)|
000002c0  00 00 00 00 00 00 08 01  00 00 08 01 00 00 20 04  |.............. .|
000002d0  00 00 01 00 00 00 08 00  00 00 04 00 00 00 00 41  |...............A|

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant