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 678949 - wrong definition of ulong_bool for 64 bit big endian machines
wrong definition of ulong_bool for 64 bit big endian machines
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.33.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-06-27 08:56 UTC by Martin Pitt
Modified: 2012-06-27 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valuetransform: Fix definition of ulong_bool (1.05 KB, patch)
2012-06-27 09:01 UTC, Martin Pitt
committed Details | Review

Description Martin Pitt 2012-06-27 08:56:01 UTC
Forwarded from http://bugs.debian.org/662057 from Philipp Kern:

------- 8< ---------
gobject/gvaluetransform.c causes the value/transform testcase
(gobject/tests/param.c) to fail on s390x, because of this:

--- glib2.0-2.31.18.orig/gobject/gvaluetransform.c
+++ glib2.0-2.31.18/gobject/gvaluetransform.c
@@ -140,7 +140,7 @@ value_transform_##func_name (const GValu
 DEFINE_BOOL_CHECK (int_bool,    v_int);
 DEFINE_BOOL_CHECK (uint_bool,   v_uint);
 DEFINE_BOOL_CHECK (long_bool,   v_long);
-DEFINE_BOOL_CHECK (ulong_bool,  v_uint);
+DEFINE_BOOL_CHECK (ulong_bool,  v_ulong);
 DEFINE_BOOL_CHECK (int64_bool,  v_int64);
 DEFINE_BOOL_CHECK (uint64_bool, v_uint64);

It tries to read a GValue's v_uint member of a ULONG Gvalue to convert that to
a boolean.  Because s390x is 64bit big endian, the v_uint member is 0 whereas
the v_ulong member has the right value.  Basically the long is too small to be
visible in the int.  The above patch causes the gobject testsuite to succeed.
(This doesn't mean that the complete glib testsuite succeeds.)
------- 8< ---------

This is confirmed on 2.33.1:

  /param/convert:                                                      OK
**
ERROR:/build/buildd-glib2.0_2.33.3-1-s390x-Ij7mxL/glib2.0-2.33.3/./gobject/tests
/param.c:364:test_value_transform: assertion failed (g_value_get_boolean (&amp;d
est) == TRUE): (0 == 1)
  /param/implement:                                                    OK

Full build log is on https://buildd.debian.org/status/fetch.php?pkg=glib2.0&arch=s390x&ver=2.33.3-1&stamp=1340742314 FYI.
Comment 1 Martin Pitt 2012-06-27 09:01:42 UTC
Created attachment 217354 [details] [review]
valuetransform: Fix definition of ulong_bool

This is Phillip's fix as a standard git format-patch. This is trivially correct, ok to push?
Comment 2 Dan Winship 2012-06-27 13:01:19 UTC
Comment on attachment 217354 [details] [review]
valuetransform: Fix definition of ulong_bool

yup
Comment 3 Martin Pitt 2012-06-27 13:33:13 UTC
Pushed.