After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 646326 - /gdbus/message-serialize-invalid test relies on a libdbus < 1.4.8 bug
/gdbus/message-serialize-invalid test relies on a libdbus < 1.4.8 bug
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.28.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-03-31 12:44 UTC by Simon McVittie
Modified: 2011-04-15 10:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
/gdbus/message-serialize-invalid test: be compatible with D-Bus 1.4.8 (4.30 KB, patch)
2011-03-31 16:11 UTC, Simon McVittie
none Details | Review

Description Simon McVittie 2011-03-31 12:44:24 UTC
The /gdbus/message-serialize-invalid regression test relies on https://bugs.freedesktop.org/show_bug.cgi?id=16338 not having been fixed: it serializes invalid messages with libdbus, but we've changed this in git for dbus 1.4.8 and 1.5.0, so writing invalid UTF-8, invalid object paths or invalid signatures is now considered to be a programming error (fatal by default).

I suggest that for the invalid-message case, you either:

* serialize a valid message into a file, hack it with a hex-editor to get the
  desired error and check the resulting blobs into git/read them from the
  ${srcdir}, or

* serialize a valid message into memory with libdbus (using a valid
  placeholder of the same length as the desired invalid string), replace
  the valid placeholder with the invalid string using memcmp/memcpy, and
  use the modified blob for testing
Comment 1 Simon McVittie 2011-03-31 16:11:45 UTC
Created attachment 184799 [details] [review]
/gdbus/message-serialize-invalid test: be compatible with D-Bus 1.4.8

Older versions of libdbus would let you construct an invalid
DBusMessage, but that's a bug, which will be fixed in 1.4.8/1.5.0.
Instead, construct a valid message of the same length, then replace
substrings in the serialized blob with their invalid counterparts.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=646326
Comment 2 David Zeuthen (not reading bugmail) 2011-04-15 10:02:06 UTC
Pushed, thanks!

http://git.gnome.org/browse/glib/commit/?id=c2387ddff164becd90654b459d8c6031c3656577
Comment 3 Simon McVittie 2011-04-15 10:23:11 UTC
This should perhaps go to 2.28 too, since it'll break the regression tests with the latest stable libdbus (1.4.8 has now been released).
Comment 4 David Zeuthen (not reading bugmail) 2011-04-15 10:27:38 UTC
(In reply to comment #3)
> This should perhaps go to 2.28 too, since it'll break the regression tests with
> the latest stable libdbus (1.4.8 has now been released).

Good point. Done.