Ionut Dinulescu wrote:
> Hi,
> 
> I tried  ValGrind on a VirtualBox running Ubuntu.

Which version?

> #include <stdlib.h>
> #include <stdio.h>
> 
> void get_mem() {
>   char *ptr;
>   ptr = (char *) malloc (10);
> }
> 
> int main(void) {
> 
>     get_mem();
> }
> 
> I compile it with -O0 -g options, then run the executable with:
>  valgrind -v --leak-check=yes ./Test
> 
> In the end, I get "All heap bloks were freed, etc".

I get

  ==28496== HEAP SUMMARY:
  ==28496==     in use at exit: 10 bytes in 1 blocks
  ==28496==   total heap usage: 1 allocs, 0 frees, 10 bytes allocated
  ==28496== 
  ==28496== 10 bytes in 1 blocks are definitely lost in loss record 1 of 1
  ==28496==    at 0x4C2683D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==28496==    by 0x400545: get_mem (in /home/thomas/tmp/memleak)
  ==28496==    by 0x400559: main (in /home/thomas/tmp/memleak)

on both 3.6.1 and SVN.


> Instead, I get a lot of  "Conditional jump or remove depends on uninitialied
> values" warnings.

Sounds like you are lacking a default suppressions file for your libc.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to