GNOME Bugzilla – Bug 678949
wrong definition of ulong_bool for 64 bit big endian machines
Last modified: 2012-06-27 13:33:34 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 (&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.
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 on attachment 217354 [details] [review] valuetransform: Fix definition of ulong_bool yup
Pushed.