GNOME Bugzilla – Bug 720984
Valgrind reports invalid read in g_utf8_collate
Last modified: 2013-12-23 17:45:31 UTC
Created attachment 264805 [details] Test program for reproducing bug Glib: 2.38.1 OS: Ubuntu 10.10 amd64 Running a simple test program under valgrind, I see memory errors whenever the g_utf8_collate function is called. See the attached glib-test.c program.
Created attachment 264807 [details] Valgrind log file Valgrind log file attached. The errors all look something like this: ==22436== Invalid read of size 8 ==22436== at 0x51D8828: wcscmp (wcscmp.S:426) ==22436== by 0x51E44AE: wcscoll_l (strcoll_l.c:489) ==22436== by 0x4EAA506: g_utf8_collate (gunicollate.c:117) ==22436== by 0x40071B: main (in /home/eenava/devel/qclsim/build/glib-test) ==22436== Address 0x59590a8 is 8 bytes inside a block of size 12 alloc'd ==22436== at 0x4C2A2DB: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==22436== by 0x4E81DD0: g_malloc (gmem.c:104) ==22436== by 0x4EAB1F3: _g_utf8_normalize_wc (gunidecomp.c:398) ==22436== by 0x4EAA4F8: g_utf8_collate (gunicollate.c:115)
This isn't glib's fault. Several glibc methods like strcmp (and apparently wcscmp) are optimized in ways that look like bugs to valgrind, but aren't actually. But your valgrind installation ought to come with suppression files to automatically ignore them, so file a bug against valgrind in Ubuntu.