GNOME Bugzilla – Bug 595133
gst/gstutils check fails
Last modified: 2009-09-15 09:31:45 UTC
This is on Mandriva Cooker i586 with gstreamer 0.10.24.2: Running suite(s): GstUtils 93%: Checks: 16, Failures: 1, Errors: 0 gst/gstutils.c:835:F:general:test_math_scale_gmp:0: error: gst_util_uint64_scale_ceil(): 2625204072 * 4273619712024848820 / 963185059 = 11647942174097927414, correct = 3308274324 FAIL: gst/gstutils
Could you attach the output of configure here or the output of grep UINT128 config.h ?
/* #undef HAVE_UINT128_T */
can you post the output of: echo "" | gcc -E -dM -
Created attachment 143161 [details] requested output
so this is on 32bits. I wonder if it happens on all 32bits. I tried recompiling it with the 64bits optimisations disabled but it still works fine here.
Ok, I can reproduce this here with: gst_util_uint64_scale_ceil (2625204072, 4273619712024848820, 963185059)
Another variant of this: gst/gstutils.c:835:F:general:test_math_scale_gmp:0: error: gst_util_uint64_scale_ceil(): 881023593 * 3005106402520480590 / 1954429577 = 1354650825618311888, correct = 1833887913
While looking at this a bit more it looks like a problem in the unit test instead because the calculated result is of course correct... I'll fix this ;)
Created attachment 143208 [details] [review] 0001-utils-Fix-GMP-scaling-unit-test.patch Possible patch. Could you check if this really fixes it for you? Problem was, that GMP only uses "unsigned long int", which is 32 bit on 32 bit architectures and can't hold a guint64.
I'm sorry, but your patch does not help. First, there is this warning, that is promoted to an error by the default -Werror flag: CC gstutils.o cc1: warnings being treated as errors gst/gstutils.c: In function 'gmp_get_uint64': gst/gstutils.c:810: error: left shift count >= width of type make[1]: *** [gstutils.o] Error 1 After removing Werror I get this: Running suite(s): GstUtils 87%: Checks: 16, Failures: 2, Errors: 0 gst/gstutils.c:886:F:general:test_math_scale_gmp:0: error: gst_util_uint64_scale_ceil(): 2882883178 * 4273619712024848820 / 963185059 = 12791255700910577540, correct = 4227317709 gst/gstutils.c:916:F:general:test_math_scale_gmp_int:0: error: gst_util_uint64_scale_int(): 3767122049 * 2021794878 / 1473265340 = 5169705589, correct = 874738293 FAIL: gst/gstutils
Created attachment 143215 [details] [review] 0001-utils-Fix-GMP-scaling-unit-test.patch Oh, stupid me. This should get rid of the warning and hopefully also fixes the unit test suite ;)
It fixes all mentioned problems, thank you.
Ok, thanks for testing :)
commit 7464062ff2f71ae77cba631489b0890e91109910 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Tue Sep 15 09:41:28 2009 +0200 utils: Fix GMP scaling unit test GMP only uses "unsigned long int", which is 32 bit on 32 bit architectures and can't hold a guint64. This resulted in false unit test failures on 32 bit architectures. Fixes bug #595133.