I am currently running Ubuntu Raring Ringtail x86. After a new installation and upgrade, I installed Valgrind 3.8.1 according to the instructions in the Learning C The Hard Way tutorial. However, I can run Valgrind, instead of specifying the line number of the error in the code, it just gives me the following:
==9300== by 0x4060714: (below main) (libc-start.c:227)
The full Valgrind report is here: http://pastebin.com/1spmkFrU
I'm sure I use the -g flag, and using --track-originins = yes will show me where the incorrect function starts, and not where the error is inside the function. (This is the result of using --track: http://pastebin.com/ktvY8HEM )
Here is the makefile code and the code I'm trying to use:
Makefile:
CFLAGS=-Wall -g EXECUTABLES=ex1 ex3 ex4 all: $(EXECUTABLES) clean: rm -f $(EXECUTABLES)
code:
#include <stdio.h> /*This program is purposefully broken */ int main() { int age = 10; int height; printf("I am %d years old.\n"); printf("I am %d inches tall.\n", height); return 0; }
source share