I have installed Bash on Ubuntu for Windows 10 and would like to be able to use Valgrind as well. However, upon running a simple hello world program for testing, the output of Valgrind states that I have a memory leak? The command I gave for installing Valgrind was: "apt install valgrind" (running as root). The current release I have of Ubuntu is: "16.04.3 LTS xenial". Also, I have installed gcc and g++ by "apt install gcc" and "apt install g++" respectively. Any ideas on how I can fix this? Thanks for any and all help.
I have not used these kinds of tools in a while but if I recall you can configure the warning level and options somewhere to reduce the junk results.
But you can never really fully get 100% accuracy. They will always miss a little, and they will always flag valid code as bad. You just have to take a look at each complaint as a human and decide if it is broken or not. Also you can do a memory leak test and only use the tool when you know you have an actual leak.
What's the error message? Please share the output, verbatim.
Which version of valgrind are you using?
Which version of g++ are you using?
How are you compiling the code? (command line)
How are you running valgrind? (command line)
With G++ 7.1.1, Clang 4.0.1, experimental Clang 5.0.0 and Valgrind 3.13.0
I don't get any errors.
If the errors are coming from the standard library or the CRT, you are probably okay. The CRT of all things is allowed to make assumptions about the system's ability to clean resources it fails to free on it's own.
On another note, it's time to compile GCC & LLVM/Clang again... *sigh* :)