Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@ubuntu:/home/ubuntu# valgrind ./a.out
- ==5561== Memcheck, a memory error detector
- ==5561== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
- ==5561== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
- ==5561== Command: ./a.out
- ==5561==
- path --> '/root'
- /root./
- /root../
- ==5561== Invalid read of size 4
- ==5561== at 0x52EC1BA: fread (iofread.c:37)
- ==5561== by 0x401B82: encryptfile (test2.c:312)
- ==5561== by 0x401976: ls_dir (test2.c:260)
- ==5561== by 0x40165B: main (test2.c:194)
- ==5561== Address 0x0 is not stack'd, malloc'd or (recently) free'd
- ==5561==
- ==5561==
- ==5561== Process terminating with default action of signal 11 (SIGSEGV)
- ==5561== Access not within mapped region at address 0x0
- ==5561== at 0x52EC1BA: fread (iofread.c:37)
- ==5561== by 0x401B82: encryptfile (test2.c:312)
- ==5561== by 0x401976: ls_dir (test2.c:260)
- ==5561== by 0x40165B: main (test2.c:194)
- ==5561== If you believe this happened as a result of a stack
- ==5561== overflow in your program's main thread (unlikely but
- ==5561== possible), you can try to increase the size of the
- ==5561== main thread stack using the --main-stacksize= flag.
- ==5561== The main thread stack size used in this run was 8388608.
- ==5561==
- ==5561== HEAP SUMMARY:
- ==5561== in use at exit: 43,125 bytes in 90 blocks
- ==5561== total heap usage: 96 allocs, 6 frees, 49,366 bytes allocated
- ==5561==
- ==5561== LEAK SUMMARY:
- ==5561== definitely lost: 0 bytes in 0 blocks
- ==5561== indirectly lost: 0 bytes in 0 blocks
- ==5561== possibly lost: 0 bytes in 0 blocks
- ==5561== still reachable: 43,125 bytes in 90 blocks
- ==5561== suppressed: 0 bytes in 0 blocks
- ==5561== Rerun with --leak-check=full to see details of leaked memory
- ==5561==
- ==5561== For counts of detected and suppressed errors, rerun with: -v
- ==5561== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
- Segmentation fault (core dumped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement