Bug 256600 - super-optimized strcasecmp() false positive
Summary: super-optimized strcasecmp() false positive
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.7 SVN
Platform: Unlisted Binaries Linux
: NOR minor
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 13:53 UTC by Dmitry Djachenko
Modified: 2011-09-28 18:26 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
add support for strcasecmp/strncasecmp (2.25 KB, patch)
2010-11-11 13:53 UTC, Dmitry Djachenko
Details
valgrind-3.6.0-strcasecmp.patch (3.71 KB, patch)
2010-11-12 10:50 UTC, Jakub Jelinek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Djachenko 2010-11-11 13:53:43 UTC
Created attachment 53319 [details]
add support for strcasecmp/strncasecmp

Version:           3.7 SVN
OS:                Linux



Reproducible: Didn't try


Actual Results:  
==23300== Use of uninitialised value of size 8
==23300==    at 0x33D63277E4: __strncasecmp_l_sse42 (strcmp.S:402)

Expected Results:  
no diagnostique

Fedora14/x64 gcc-4.5.1
Comment 1 Jakub Jelinek 2010-11-11 18:41:24 UTC
Yeah, this is quite severe problem in valgrind against recentish glibcs.

+/* ??? STRCASECMP(VG_Z_LD_LINUX_X86_64_SO_2, strcasecmp) */
+/* ??? STRCASECMP(VG_Z_LD64_SO_1,            strcasecmp) */

is unnecessary, neither strcasecmp nor strncasecmp is ever present in ld.so.

That said, the patch should also handle strcasecmp_l and strncasecmp_l, which will need some configure magic to detect tolower_l/strcasecmp_l.

This could be also solvable using suppressions, but then we wouldn't diagnose invalid uses of strcasecmp by the apps.
Comment 2 Tom Hughes 2010-11-12 01:17:19 UTC
What do the _l variants do? They don't seem to have any manual page on my F14 systems...
Comment 4 Jakub Jelinek 2010-11-12 10:50:25 UTC
Created attachment 53355 [details]
valgrind-3.6.0-strcasecmp.patch

Updated patch to also handle strcasecmp_l and strncasecmp_l.
Comment 5 Tom Hughes 2010-11-12 11:14:12 UTC
Looks like we crossed - I just committed an extended version of the patch as r11478.
Comment 6 Tom Hughes 2011-09-28 18:26:37 UTC
*** Bug 282979 has been marked as a duplicate of this bug. ***