Hello,

I try to use valgrind to find the memory segmentation bug in my program.
When I run it with valgrind, I get a lot of errors such as "Use of
uninitialised value" and "Conditional jump or move depends on uninitialised
value(s)". And most of errors point to some standard libraries such as
glibc and pthread. I can't even see the errors caused by my program. Some
of them are shown below. I tried to suppress them with --suppressions, but
there are just too many. It's really difficult for me to list all errors
caused by the libraries.

Is this normal? Is it because my program is written in C++? How do I
suppress these errors very effectively? or these errors are actually caused
by some bugs of my program?

Thanks,
Da


==32701== Syscall param set_robust_list(head) points to uninitialised
byte(s)
==32701==    at 0x41B141: __pthread_initialize_minimal (nptl-init.c:309)
==32701==    by 0x47F720: (below main) (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==  Address 0x4000bd0 is not stack'd, malloc'd or (recently) free'd
==32701==
==32701== Conditional jump or move depends on uninitialised value(s)
==32701==    at 0x4CB436: __register_atfork (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4CB558: __libc_pthread_init (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x41B3A8: __pthread_initialize_minimal (nptl-init.c:445)
==32701==    by 0x47F720: (below main) (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==
==32701== Conditional jump or move depends on uninitialised value(s)
==32701==    at 0x4CB4E6: __linkin_atfork (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x49CB66: ptmalloc_init (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4A0AD3: malloc_hook_ini (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4FD972: _dl_init_paths (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4CCC58: _dl_non_dynamic_init (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4CD762: __libc_init_first (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x47F795: (below main) (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==
==32701== Conditional jump or move depends on uninitialised value(s)
==32701==    at 0x4A618F: strlen (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4FB3D2: fillin_rpath (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4FDBCB: _dl_init_paths (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4CCC58: _dl_non_dynamic_init (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4CD762: __libc_init_first (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x47F795: (below main) (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==
==32701== Conditional jump or move depends on uninitialised value(s)
==32701==    at 0x4FB3D9: fillin_rpath (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4FDBCB: _dl_init_paths (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4CCC58: _dl_non_dynamic_init (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x4CD762: __libc_init_first (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==    by 0x47F795: (below main) (in
/home/zhengda/Dropbox/research/read-test/rand-read)
==32701==
...

==32701== Use of uninitialised value of size 8
==32701==    at 0x405A23: std::vector<page_cache*,
std::allocator<page_cache*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<page_cache**,
std::vector<page_cache*, std::allocator<page_cache*> > >, page_cache*
const&) (vector.tcc:338)
==32701==    by 0x404A71: std::vector<page_cache*,
std::allocator<page_cache*> >::push_back(page_cache* const&)
(stl_vector.h:749)
==32701==    by 0x402364: memory_manager::register_cache(page_cache*)
(memory_manager.h:82)
==32701==    by 0x403991:
hash_index_cache::hash_index_cache(memory_manager*) (hash_index_cache.h:235)
==32701==    by 0x404441: global_cached_private::create_cache(int, long,
memory_manager*) (global_cached_private.h:43)
==32701==    by 0x410B11: global_cached_private::global_cached_private(char
const**, int, long, int, long, int, int, memory_manager*)
(global_cached_private.h:66)
==32701==    by 0x40F0E7: main (rand-read.cc:439)
==32701==
==32701== Use of uninitialised value of size 8
==32701==    at 0x405A51: std::vector<page_cache*,
std::allocator<page_cache*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<page_cache**,
std::vector<page_cache*, std::allocator<page_cache*> > >, page_cache*
const&) (vector.tcc:344)
==32701==    by 0x404A71: std::vector<page_cache*,
std::allocator<page_cache*> >::push_back(page_cache* const&)
(stl_vector.h:749)
==32701==    by 0x402364: memory_manager::register_cache(page_cache*)
(memory_manager.h:82)
==32701==    by 0x403991:
hash_index_cache::hash_index_cache(memory_manager*) (hash_index_cache.h:235)
==32701==    by 0x404441: global_cached_private::create_cache(int, long,
memory_manager*) (global_cached_private.h:43)
==32701==    by 0x410B11: global_cached_private::global_cached_private(char
const**, int, long, int, long, int, int, memory_manager*)
(global_cached_private.h:66)
==32701==    by 0x40F0E7: main (rand-read.cc:439)
==32701==
==32701== Use of uninitialised value of size 8
==32701==    at 0x405A8D: std::vector<page_cache*,
std::allocator<page_cache*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<page_cache**,
std::vector<page_cache*, std::allocator<page_cache*> > >, page_cache*
const&) (vector.tcc:359)
==32701==    by 0x404A71: std::vector<page_cache*,
std::allocator<page_cache*> >::push_back(page_cache* const&)
(stl_vector.h:749)
==32701==    by 0x402364: memory_manager::register_cache(page_cache*)
(memory_manager.h:82)
==32701==    by 0x403991:
hash_index_cache::hash_index_cache(memory_manager*) (hash_index_cache.h:235)
==32701==    by 0x404441: global_cached_private::create_cache(int, long,
memory_manager*) (global_cached_private.h:43)
==32701==    by 0x410B11: global_cached_private::global_cached_private(char
const**, int, long, int, long, int, int, memory_manager*)
(global_cached_private.h:66)
==32701==    by 0x40F0E7: main (rand-read.cc:439)
==32701==
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to