$ gdb --args ./a.out big.bad.testfile [gdb]> run Starting program: /home/user/a.out big.bad.testfile Program received signal SIGSEGV, Segmentation fault. 0x08048646 in getinp (filename=0xbf9c75b1 "big.bad.testfile") at fail.c:34 34 arr[pos] = c; [gdb]> p size $1 = 65536 [gdb]> p pos $2 = 33700 [gdb]> p arr[pos-1] $3 = 9 [gdb]> p arr[pos] Cannot access memory at address 0x806b000