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 720984 - Valgrind reports invalid read in g_utf8_collate
Valgrind reports invalid read in g_utf8_collate
Status: RESOLVED NOTGNOME
Product: glib
Classification: Platform
Component: general
2.38.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-12-23 17:14 UTC by Alex Valavanis
Modified: 2013-12-23 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program for reproducing bug (905 bytes, text/x-csrc)
2013-12-23 17:14 UTC, Alex Valavanis
Details
Valgrind log file (8.93 KB, text/x-log)
2013-12-23 17:22 UTC, Alex Valavanis
Details

Description Alex Valavanis 2013-12-23 17:14:35 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.
Comment 1 Alex Valavanis 2013-12-23 17:22:55 UTC
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)
Comment 2 Dan Winship 2013-12-23 17:45:31 UTC
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.