I'm running valgrind
on two very simple 'hello world' programs. They are both returning the same error:
laptop$ g++ hello.cpp -o hello
laptop$ valgrind ./hello
Killed: 9
laptop$ g++ hello2.cpp -o hello2
laptop$ valgrind ./hello2
Killed: 9
My hello2.cpp looks like this:
#include <stdio.h>
int main(void)
{
printf("main.c\n");
return 0;
}
The other hello world program simply uses cout
from iostream
instead of printf()
. One important thing to note is that valgrind works as expected on Ubuntu server 14.04, and these failing examples are on my new Macbook Pro running OSX 10.10. I've searched around and everything I find is relating to large programs with complex memory issues.
Why am I getting this error on my Mac?