I've been trying to run Valgrind on an application, and found a ridicolous
amount of false positives. It was suggested to me I should email this list
with errors. I identified the function setlocale to be "errorneous"
So I created a small program in C:

*#include <stdio.h>
>>> #include <locale.h>
>>>
>>> main(){
>>>     setlocale(LC_ALL, "");
>>> }*
>>>
>>> This created a huge log:

*$ valgrind --leak-check=yes -v --track-origins=yes ./val2
==23068== Memcheck, a memory error detector
==23068== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==23068== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==23068== Command: ./val2
==23068==
--23068-- Valgrind options:
--23068--    --leak-check=yes
--23068--    -v
--23068--    --track-origins=yes
--23068-- Contents of /proc/version:
--23068--   Linux version 3.1.1-1-ARCH (tobias@T-POWA-LX) (gcc version
4.6.2 (GCC) ) #1 SMP PREEMPT Fri Nov 11 22:05:37 UTC 2011
--23068-- Arch and hwcaps: X86, x86-sse1-sse2
--23068-- Page sizes: currently 4096, max supported 4096
--23068-- Valgrind library directory: /usr/lib/valgrind
--23068-- Reading syms from /lib/ld-2.14.1.so (0x4000000)
--23068-- Reading syms from
/home/drumm/Dropbox/Programming/C/Valgrind-DONOTCOPY/val2 (0x8048000)
--23068-- Reading syms from /usr/lib/valgrind/memcheck-x86-linux (0x38000000)
--23068--    object doesn't have a symbol table
--23068--    object doesn't have a dynamic symbol table
--23068-- Reading suppressions file: /usr/lib/valgrind/default.supp
==23068== embedded gdbserver: reading from
/tmp/vgdb-pipe-from-vgdb-to-23068-by-drumm-on-???
==23068== embedded gdbserver: writing to
/tmp/vgdb-pipe-to-vgdb-from-23068-by-drumm-on-???
==23068== embedded gdbserver: shared mem
/tmp/vgdb-pipe-shared-mem-vgdb-23068-by-drumm-on-???
==23068==
==23068== TO CONTROL THIS PROCESS USING vgdb (which you probably
==23068== don't want to do, unless you know exactly what you're doing,
==23068== or are doing some strange experiment):
==23068==   /usr/lib/valgrind/../../bin/vgdb --pid=23068 ...command...
==23068==
==23068== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==23068==   /path/to/gdb ./val2
==23068== and then give GDB the following command
==23068==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=23068
==23068== --pid is optional if only one valgrind process is running
==23068==
--23068-- REDIR: 0x4017970 (strlen) redirected to 0x38056b04 (???)
--23068-- REDIR: 0x40177b0 (index) redirected to 0x38056adf (???)
--23068-- Reading syms from
/usr/lib/valgrind/vgpreload_core-x86-linux.so (0x4023000)
--23068--    object doesn't have a symbol table
--23068-- Reading syms from
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so (0x4026000)
--23068--    object doesn't have a symbol table
--23068-- Reading syms from /lib/libc-2.14.1.so (0x4053000)
--23068--    object doesn't have a symbol table
--23068-- REDIR: 0x40c92f0 (rindex) redirected to 0x402a320 (rindex)
--23068-- REDIR: 0x40c8740 (index) redirected to 0x402a430 (index)
--23068-- REDIR: 0x40cb860 (strchrnul) redirected to 0x402cd90 (strchrnul)
--23068-- REDIR: 0x40c5090 (malloc) redirected to 0x4029fb0 (malloc)
==23068== Invalid read of size 4
==23068==    at 0x40C901B: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==  Address 0x41d002c is 4 bytes inside a block of size 5 alloc'd
==23068==    at 0x402A018: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23068==    by 0x407E42B: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40784A4: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==
--23068-- REDIR: 0x40c5540 (free) redirected to 0x40291b0 (free)
==23068== Conditional jump or move depends on uninitialised value(s)
==23068==    at 0x40C9043: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==  Uninitialised value was created by a stack allocation
==23068==    at 0x4077E11: ??? (in /lib/libc-2.14.1.so)
==23068==
==23068== Conditional jump or move depends on uninitialised value(s)
==23068==    at 0x40C904D: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==  Uninitialised value was created by a stack allocation
==23068==    at 0x4077E11: ??? (in /lib/libc-2.14.1.so)
==23068==
==23068==
==23068== HEAP SUMMARY:
==23068==     in use at exit: 0 bytes in 0 blocks
==23068==   total heap usage: 28 allocs, 28 frees, 1,953 bytes allocated
==23068==
==23068== All heap blocks were freed -- no leaks are possible
==23068==
==23068== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 13 from 8)
==23068==
==23068== 1 errors in context 1 of 3:
==23068== Conditional jump or move depends on uninitialised value(s)
==23068==    at 0x40C904D: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==  Uninitialised value was created by a stack allocation
==23068==    at 0x4077E11: ??? (in /lib/libc-2.14.1.so)
==23068==
==23068==
==23068== 1 errors in context 2 of 3:
==23068== Conditional jump or move depends on uninitialised value(s)
==23068==    at 0x40C9043: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==  Uninitialised value was created by a stack allocation
==23068==    at 0x4077E11: ??? (in /lib/libc-2.14.1.so)
==23068==
==23068==
==23068== 1 errors in context 3 of 3:
==23068== Invalid read of size 4
==23068==    at 0x40C901B: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==  Address 0x41d002c is 4 bytes inside a block of size 5 alloc'd
==23068==    at 0x402A018: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23068==    by 0x407E42B: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40784A4: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x40771E8: ??? (in /lib/libc-2.14.1.so)
==23068==    by 0x4076D33: setlocale (in /lib/libc-2.14.1.so)
==23068==    by 0x8048400: main (val2.c:5)
==23068==
--23068--
--23068-- used_suppression:     13 U1004-ARM-_dl_relocate_object
==23068==
==23068== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 13 from 8)*

I am using Arch Linux (Which I think is in the above log, but regardless)
I'm not sure if I have done something wrong, or there's an issue with the
Arch package. But either way I am stuck.Thanks for any help you guys can
provide to me.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to