FS#30643 - [glibc] valgrind reports invalid read in wcslen
Attached to Project:
Arch Linux
Opened by Mr.Magne (Mr.Magne) - Wednesday, 11 July 2012, 17:21 GMT
Last edited by Allan McRae (Allan) - Thursday, 25 October 2012, 00:03 GMT
Opened by Mr.Magne (Mr.Magne) - Wednesday, 11 July 2012, 17:21 GMT
Last edited by Allan McRae (Allan) - Thursday, 25 October 2012, 00:03 GMT
|
Details
Description:
I'm pretty sure it's an upstream bug, but they recommend to report downstream first. The following code sample, build with [code]gcc test_wcslen.c[/code] and executed with [code]valgrind ./a.out[/code] reports invalid read (and also Conditional jump or move depends on uninitialised value(s) ). When the array is statically allocated ther is no invalid read. Additional info: * package version(s) core/glibc 2.16.0-1 (base) [installed] multilib/gcc-libs-multilib 4.7.1-4.1 [installed] extra/valgrind 3.7.0-3 [installed] * config and/or log files etc. x86_64 Steps to reproduce: gcc test_wcslen.c valgrind ./a.out |
This task depends upon
Closed by Allan McRae (Allan)
Thursday, 25 October 2012, 00:03 GMT
Reason for closing: Upstream
Additional comments about closing: spurious warning by valgrind
Thursday, 25 October 2012, 00:03 GMT
Reason for closing: Upstream
Additional comments about closing: spurious warning by valgrind
I am very sure this is a false positive. Valgrind has always had issues with wcslen since the optimized versions were added (in glibc-2.15 and unchanged in glibc-2.16...).
curl http://sprunge.us/XibB -o wcslen.s
Useful if you want line numbers or file a bugreport (somwehere) for easy reproducing.
int main() {
return 0;
}
Where attached file t.log is result of valgrind with parameter --track-origins=yes.
Version info:
glibc 2.16.0-2
valgrind 3.7.0-3
gcc-libs-multilib 4.7.1-4.1
Linux u40 3.4.4-3-ARCH #1 SMP PREEMPT Tue Jul 3 14:36:44 UTC 2012 x86_64 GNU/Linux
uname -a
Linux trex-j 3.4.5-1-ARCH #1 SMP PREEMPT Mon Jul 16 21:35:54 CEST 2012 x86_64 GNU/Linux
[1] http://stackoverflow.com/questions/11506370/valgrind-reports-unitialized-values-on-empty-c-program
[2] https://bugzilla.redhat.com/show_bug.cgi?id=798968
And I am afraid I don't know how to use the preprocessed file given by Jason William Walton...
glibc 2.16.0-2
valgrind 3.7.0-4
gcc-libs-multilib 4.7.1-5
linux 3.4.7-1
linux 3.4.6-1
valgrind 3.7.0-4
glibc 2.16.0-2
gcc-libs-multilib 4.7.1-5
installing linux 3.4.7 and rebooting to test it...
EDIT: same problem with linux 3.4.7-1
linux 3.4.8-1
valgrind 3.8.0-1
glibc 2.16.0-2
gcc-libs-multilib 4.7.1-5