Click here to Skip to main content
15,843,144 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Quote:
I just as of yesterday installed Ubuntu(terminal) on my windows computer. In addition, when ahead and installed Valgrind, "sudo apt install Valgrind", to test everything out I went ahead and create a c++ hello world program. Then tested it with Valgrind. The Valgrind said I had about "72,704 bytes in 1 block". Further research, I performed suggested this was a bug of Valgrind with the c++ standard library functions, possible the iostream. My question is how do I go about fixing this bug. I can't ignore because if I am working on programs I need to able to accurately gauge where it's coming from. If anyone can provide a step by step solution for my problem in layman's term for the problem it would be invaluable. here is my code and errors I get:


C++
#include <iostream>
using std::cout; using std endl;

int main(){
  cout << "hello world" <<endl;
}




HTML
==175== Memcheck, a memory error detector
==175== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==175== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==175== Command: ./helloworld
==175==
Hello World
==175==
==175== HEAP SUMMARY:
==175==     in use at exit: 72,704 bytes in 1 blocks
==175==   total heap usage: 2 allocs, 1 frees, 76,800 bytes allocated
==175==
==175== LEAK SUMMARY:
==175==    definitely lost: 0 bytes in 0 blocks
==175==    indirectly lost: 0 bytes in 0 blocks
==175==      possibly lost: 0 bytes in 0 blocks
==175==    still reachable: 72,704 bytes in 1 blocks
==175==         suppressed: 0 bytes in 0 blocks
==175== Rerun with --leak-check=full to see details of leaked memory
==175==
==175== For counts of detected and suppressed errors, rerun with: -v
==175== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


What I have tried:

Honestly, nothing because I don't know what to do and the answers I found online weren't concrete.
Posted
Updated 23-Jul-17 8:24am
v2
Comments
Richard MacCutchan 23-Jul-17 10:10am    
The report says no errors so what are you concerned about? If you think Valgrind has a bug then you should go back to Valgrind Home[^] to see what they say.
John Last 23-Jul-17 13:23pm    
I don't believe I said anything but errors I was specifically talking about the false leaks I had

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900