Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory checks via valgrind #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wookietreiber
Copy link
Collaborator

I have added compression and decompression memory checks via valgrind. I do not know yet, if travis will actually show the valgrind output, but anyone interested can clone my memory-checks branch and see for themselfes.

Fixes for these memory checks will be added to that branch and, implicitly, this pull request.

Addresses #8.

@cicku
Copy link
Collaborator

cicku commented Sep 8, 2015

Please don't add valgrind test to check, runs at travis only (Even cppcheck shouldn't be added to make check IMO, since it's the work done before release. make check should only do check on end user's system to see different/weird/out-of-control behaviors).

Being as a distro packager, I can't guarantee what will happen to each update of valgrind.

@wookietreiber
Copy link
Collaborator Author

I agree, that valgrind and cppcheck tests should be optional, i.e. configure should only optionally check for these tools and disable the tests if they are not available.

@wookietreiber
Copy link
Collaborator Author

Funny, the travis check passes. However, I still get these three errors:

==16591== Memcheck, a memory error detector
==16591== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==16591== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==16591== Command: ../src/pixz -d decompression-memcheck.sh.pixz decompression-memcheck.sh.uncompressed
==16591== 
==16591== 
==16591== HEAP SUMMARY:
==16591==     in use at exit: 1,824 bytes in 9 blocks
==16591==   total heap usage: 88 allocs, 79 frees, 16,863,346 bytes allocated
==16591== 
==16591== 112 bytes in 1 blocks are definitely lost in loss record 4 of 9
==16591==    at 0x4C2AF1F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16591==    by 0x541498D: ??? (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x5406C84: lzma_filter_flags_decode (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x540675E: lzma_block_header_decode (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x4032A5: decode_file_index_start (common.c:106)
==16591==    by 0x4032A5: find_file_index.constprop.2 (common.c:128)
==16591==    by 0x403410: read_file_index (common.c:158)
==16591==    by 0x404EC5: pixz_read (read.c:99)
==16591==    by 0x40273C: main (pixz.c:166)
==16591== 
==16591== 112 bytes in 1 blocks are definitely lost in loss record 5 of 9
==16591==    at 0x4C2AF1F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16591==    by 0x541498D: ??? (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x5406C84: lzma_filter_flags_decode (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x540675E: lzma_block_header_decode (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x403E8B: decode_thread (read.c:575)
==16591==    by 0x402A19: pipeline_thread_process (common.c:519)
==16591==    by 0x56292E6: start_thread (in /usr/lib/libpthread-2.25.so)
==16591== 
==16591== 168 (96 direct, 72 indirect) bytes in 1 blocks are definitely lost in loss record 7 of 9
==16591==    at 0x4C2AF1F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==16591==    by 0x53FF65D: ??? (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x5407147: lzma_index_decoder (in /usr/lib/liblzma.so.5.2.3)
==16591==    by 0x402D5B: next_index (common.c:315)
==16591==    by 0x4030E9: decode_index (common.c:356)
==16591==    by 0x404B10: pixz_read (read.c:97)
==16591==    by 0x40273C: main (pixz.c:166)
==16591== 
==16591== LEAK SUMMARY:
==16591==    definitely lost: 320 bytes in 3 blocks
==16591==    indirectly lost: 72 bytes in 1 blocks
==16591==      possibly lost: 0 bytes in 0 blocks
==16591==    still reachable: 1,432 bytes in 5 blocks
==16591==         suppressed: 0 bytes in 0 blocks
==16591== Reachable blocks (those to which a pointer was found) are not shown.
==16591== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==16591== 
==16591== For counts of detected and suppressed errors, rerun with: -v
==16591== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)

If anyone can help, please do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants