io:~/memtest% ./malloc-test-cc 10 Please enter a command: a 0 10 Please enter a command: qa i b allocates b bytes for array entry i. d i will deallocate memory at entry i. r i p will read the pth character from array i. w i p will write to the pth character in array i. q quits.
io:~/memtest% ./malloc-test-cc 10 Please enter a command: a 0 10 Please enter a command: d 0 Please enter a command: d 0and reads of unallocated data
io:~/memtest% ./malloc-test-cc 10 Please enter a command: r 1 1but not reads/writes after deallocation
io:~/memtest% ./malloc-test-cc 10 Please enter a command: a 0 10 Please enter a command: d 0 10 Please enter a command: r 0 1
io:~/memtest% ./malloc-test-ef 10 Please enter a command: a 0 10 Please enter a command: qbut it can find double deallocations and reads/writes after end of allocation and after deallocation
io:~/memtest% ./malloc-test-ef 10 Please enter a command: a 0 10 Please enter a command: r 0 10 Please enter a command: d 0 Please enter a command: d 0 Please enter a command: r 0 1
io:~/memtest% export EF_PROTECT_BELOW=1 io:~/memtest% ./malloc-test-ef 10 Please enter a command: a 0 10 Please enter a command: r 0 -1