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 leaks #11

Open
mgood7123 opened this issue Aug 30, 2020 · 1 comment
Open

memory leaks #11

mgood7123 opened this issue Aug 30, 2020 · 1 comment

Comments

@mgood7123
Copy link
Contributor

mgood7123 commented Aug 30, 2020

please fix your memory leaks

YOUR Master branch

valgrind --leak-check=full --show-leak-kinds=all -s --track-origins=yes ./pipe_debug
==325637== Memcheck, a memory error detector
==325637== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==325637== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==325637== Command: ./pipe_debug
==325637== 
basic_storage -> [  OK  ]
pipeline_multiplier -> [  OK  ]
parallel_multiplier -> [  OK  ]
issue_4 -> [  OK  ]
issue_5 -> [  OK  ]
==325637== 
==325637== HEAP SUMMARY:
==325637==     in use at exit: 3,264 bytes in 12 blocks
==325637==   total heap usage: 874 allocs, 862 frees, 162,456,980 bytes allocated
==325637== 
==325637== 272 bytes in 1 blocks are possibly lost in loss record 1 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C3B5: va_pipe_pipeline (pipe_util.c:158)
==325637==    by 0x10C4D3: pipe_pipeline (pipe_util.c:173)
==325637==    by 0x10B879: test_pipeline_multiplier (pipe_test.c:153)
==325637==    by 0x10BE7C: pipe_run_test_suite (pipe_test.c:306)
==325637==    by 0x10C524: main (main.c:5)
==325637== 
==325637== 272 bytes in 1 blocks are possibly lost in loss record 2 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C3B5: va_pipe_pipeline (pipe_util.c:158)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C4D3: pipe_pipeline (pipe_util.c:173)
==325637==    by 0x10B879: test_pipeline_multiplier (pipe_test.c:153)
==325637==    by 0x10BE7C: pipe_run_test_suite (pipe_test.c:306)
==325637==    by 0x10C524: main (main.c:5)
==325637== 
==325637== 272 bytes in 1 blocks are possibly lost in loss record 3 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C3B5: va_pipe_pipeline (pipe_util.c:158)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C4D3: pipe_pipeline (pipe_util.c:173)
==325637==    by 0x10B879: test_pipeline_multiplier (pipe_test.c:153)
==325637==    by 0x10BE7C: pipe_run_test_suite (pipe_test.c:306)
==325637==    by 0x10C524: main (main.c:5)
==325637== 
==325637== 272 bytes in 1 blocks are possibly lost in loss record 4 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C3B5: va_pipe_pipeline (pipe_util.c:158)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C4D3: pipe_pipeline (pipe_util.c:173)
==325637==    by 0x10B879: test_pipeline_multiplier (pipe_test.c:153)
==325637==    by 0x10BE7C: pipe_run_test_suite (pipe_test.c:306)
==325637== 
==325637== 272 bytes in 1 blocks are possibly lost in loss record 5 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C3B5: va_pipe_pipeline (pipe_util.c:158)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C4D3: pipe_pipeline (pipe_util.c:173)
==325637==    by 0x10B879: test_pipeline_multiplier (pipe_test.c:153)
==325637== 
==325637== 272 bytes in 1 blocks are possibly lost in loss record 6 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C3B5: va_pipe_pipeline (pipe_util.c:158)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C4D3: pipe_pipeline (pipe_util.c:173)
==325637== 
==325637== 544 bytes in 2 blocks are possibly lost in loss record 7 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C3B5: va_pipe_pipeline (pipe_util.c:158)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637==    by 0x10C3E8: va_pipe_pipeline (pipe_util.c:163)
==325637== 
==325637== 1,088 bytes in 4 blocks are possibly lost in loss record 8 of 8
==325637==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325637==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325637==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325637==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325637==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325637==    by 0x10BF4D: thread_create (pipe_util.c:49)
==325637==    by 0x10C16B: pipe_connect (pipe_util.c:110)
==325637==    by 0x10C1EC: pipe_parallel (pipe_util.c:123)
==325637==    by 0x10B93D: test_parallel_multiplier (pipe_test.c:175)
==325637==    by 0x10BEAA: pipe_run_test_suite (pipe_test.c:307)
==325637==    by 0x10C524: main (main.c:5)
==325637== 
==325637== LEAK SUMMARY:
==325637==    definitely lost: 0 bytes in 0 blocks
==325637==    indirectly lost: 0 bytes in 0 blocks
==325637==      possibly lost: 3,264 bytes in 12 blocks
==325637==    still reachable: 0 bytes in 0 blocks
==325637==         suppressed: 0 bytes in 0 blocks
==325637== 
==325637== ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 0 from 0)
valgrind --leak-check=full --show-leak-kinds=all -s --track-origins=yes ./pipe_release
==325699== Memcheck, a memory error detector
==325699== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==325699== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==325699== Command: ./pipe_release
==325699== 
basic_storage -> [  OK  ]
pipeline_multiplier -> [  OK  ]
parallel_multiplier -> [  OK  ]
issue_4 -> [  OK  ]
issue_5 -> [  OK  ]
==325699== 
==325699== HEAP SUMMARY:
==325699==     in use at exit: 3,264 bytes in 12 blocks
==325699==   total heap usage: 1,642 allocs, 1,630 frees, 164,161,428 bytes allocated
==325699== 
==325699== 544 bytes in 2 blocks are possibly lost in loss record 1 of 3
==325699==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325699==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325699==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325699==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325699==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325699==    by 0x10B782: pipe_parallel (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699==    by 0x10AD5C: pipe_run_test_suite (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699==    by 0x10924C: main (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699== 
==325699== 544 bytes in 2 blocks are possibly lost in loss record 2 of 3
==325699==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325699==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325699==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325699==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325699==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325699==    by 0x10B7D1: pipe_parallel (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699==    by 0x10AD5C: pipe_run_test_suite (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699==    by 0x10924C: main (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699== 
==325699== 2,176 bytes in 8 blocks are possibly lost in loss record 3 of 3
==325699==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==325699==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==325699==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==325699==    by 0x4876322: allocate_stack (allocatestack.c:622)
==325699==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==325699==    by 0x10B958: pipe_pipeline (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699==    by 0x10AB81: pipe_run_test_suite (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699==    by 0x10924C: main (in /home/smallville7123/AndroidCompositor/app/src/main/jni/GLIS/examples/pipe2/pipe_release)
==325699== 
==325699== LEAK SUMMARY:
==325699==    definitely lost: 0 bytes in 0 blocks
==325699==    indirectly lost: 0 bytes in 0 blocks
==325699==      possibly lost: 3,264 bytes in 12 blocks
==325699==    still reachable: 0 bytes in 0 blocks
==325699==         suppressed: 0 bytes in 0 blocks
==325699== 
==325699== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
# do not know equivilant flags for these, attempting to specify generates unknown option
valgrind --tool=callgrind --dump-instr=yes --trace-jump=yes ./pipe_release
==325742== Callgrind, a call-graph generating cache profiler
==325742== Copyright (C) 2002-2017, and GNU GPL'd, by Josef Weidendorfer et al.
==325742== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==325742== Command: ./pipe_release
==325742== 
==325742== For interactive control, run 'callgrind_control -h'.
basic_storage -> [  OK  ]
pipeline_multiplier -> [  OK  ]
parallel_multiplier -> [  OK  ]
issue_4 -> [  OK  ]
issue_5 -> [  OK  ]
==325742== 
==325742== Events    : Ir
==325742== Collected : 506741867
==325742== 
==325742== I   refs:      506,741,867
valgrind --tool=cachegrind ./pipe_release
==325758== Cachegrind, a cache and branch-prediction profiler
==325758== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==325758== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==325758== Command: ./pipe_release
==325758== 
--325758-- warning: L3 cache found, using its data for the LL simulation.
basic_storage -> [  OK  ]
pipeline_multiplier -> [  OK  ]
parallel_multiplier -> [  OK  ]
issue_4 -> [  OK  ]
issue_5 -> [  OK  ]
==325758== 
==325758== I   refs:      525,712,605
==325758== I1  misses:          1,863
==325758== LLi misses:          1,818
==325758== I1  miss rate:        0.00%
==325758== LLi miss rate:        0.00%
==325758== 
==325758== D   refs:      224,821,010  (137,149,616 rd   + 87,671,394 wr)
==325758== D1  misses:      4,132,523  (  2,030,666 rd   +  2,101,857 wr)
==325758== LLd misses:      2,799,043  (    939,656 rd   +  1,859,387 wr)
==325758== D1  miss rate:         1.8% (        1.5%     +        2.4%  )
==325758== LLd miss rate:         1.2% (        0.7%     +        2.1%  )
==325758== 
==325758== LL refs:         4,134,386  (  2,032,529 rd   +  2,101,857 wr)
==325758== LL misses:       2,800,861  (    941,474 rd   +  1,859,387 wr)
==325758== LL miss rate:          0.4% (        0.1%     +        2.1%  )
valgrind --tool=massif ./pipe_release
==325771== Massif, a heap profiler
==325771== Copyright (C) 2003-2017, and GNU GPL'd, by Nicholas Nethercote
==325771== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==325771== Command: ./pipe_release
==325771== 
basic_storage -> [  OK  ]
pipeline_multiplier -> [  OK  ]
parallel_multiplier -> [  OK  ]
issue_4 -> [  OK  ]
issue_5 -> [  OK  ]
==325771== 

my https://github.com/mgood7123/pipe that has the fix from issue 6 applied

valgrind --leak-check=full --show-leak-kinds=all -s --track-origins=yes ./pipe_debug
==324672== Memcheck, a memory error detector
==324672== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==324672== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==324672== Command: ./pipe_debug
==324672== 
basic_storage -> [  OK  ]
pipeline_multiplier -> [  OK  ]
parallel_multiplier -> [  OK  ]
issue_4 -> [  OK  ]
issue_5 -> [  OK  ]
issue_6_a -> [  OK  ]
issue_6_b -> [  OK  ]
issue_6_c -> [  OK  ]
==324672== 
==324672== HEAP SUMMARY:
==324672==     in use at exit: 3,536 bytes in 13 blocks
==324672==   total heap usage: 2,159 allocs, 2,146 frees, 168,726,704 bytes allocated
==324672== 
==324672== 272 bytes in 1 blocks are possibly lost in loss record 1 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10D002: va_pipe_pipeline (pipe_util.c:158)
==324672==    by 0x10D120: pipe_pipeline (pipe_util.c:173)
==324672==    by 0x10B8EF: test_pipeline_multiplier (pipe_test.c:157)
==324672==    by 0x10CA3F: pipe_run_test_suite (pipe_test.c:449)
==324672==    by 0x10D171: main (main.c:5)
==324672== 
==324672== 272 bytes in 1 blocks are possibly lost in loss record 2 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10D002: va_pipe_pipeline (pipe_util.c:158)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D120: pipe_pipeline (pipe_util.c:173)
==324672==    by 0x10B8EF: test_pipeline_multiplier (pipe_test.c:157)
==324672==    by 0x10CA3F: pipe_run_test_suite (pipe_test.c:449)
==324672==    by 0x10D171: main (main.c:5)
==324672== 
==324672== 272 bytes in 1 blocks are possibly lost in loss record 3 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10D002: va_pipe_pipeline (pipe_util.c:158)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D120: pipe_pipeline (pipe_util.c:173)
==324672==    by 0x10B8EF: test_pipeline_multiplier (pipe_test.c:157)
==324672==    by 0x10CA3F: pipe_run_test_suite (pipe_test.c:449)
==324672==    by 0x10D171: main (main.c:5)
==324672== 
==324672== 272 bytes in 1 blocks are possibly lost in loss record 4 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10D002: va_pipe_pipeline (pipe_util.c:158)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D120: pipe_pipeline (pipe_util.c:173)
==324672==    by 0x10B8EF: test_pipeline_multiplier (pipe_test.c:157)
==324672==    by 0x10CA3F: pipe_run_test_suite (pipe_test.c:449)
==324672== 
==324672== 272 bytes in 1 blocks are possibly lost in loss record 5 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10D002: va_pipe_pipeline (pipe_util.c:158)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D120: pipe_pipeline (pipe_util.c:173)
==324672==    by 0x10B8EF: test_pipeline_multiplier (pipe_test.c:157)
==324672== 
==324672== 272 bytes in 1 blocks are possibly lost in loss record 6 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10D002: va_pipe_pipeline (pipe_util.c:158)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D120: pipe_pipeline (pipe_util.c:173)
==324672== 
==324672== 272 bytes in 1 blocks are possibly lost in loss record 7 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10C562: thread_create (pipe_test.c:323)
==324672==    by 0x10C832: test_issue_6_c (pipe_test.c:372)
==324672==    by 0x10CB53: pipe_run_test_suite (pipe_test.c:455)
==324672==    by 0x10D171: main (main.c:5)
==324672== 
==324672== 544 bytes in 2 blocks are possibly lost in loss record 8 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10D002: va_pipe_pipeline (pipe_util.c:158)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672==    by 0x10D035: va_pipe_pipeline (pipe_util.c:163)
==324672== 
==324672== 1,088 bytes in 4 blocks are possibly lost in loss record 9 of 9
==324672==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==324672==    by 0x40149CA: allocate_dtv (dl-tls.c:286)
==324672==    by 0x40149CA: _dl_allocate_tls (dl-tls.c:532)
==324672==    by 0x4876322: allocate_stack (allocatestack.c:622)
==324672==    by 0x4876322: pthread_create@@GLIBC_2.2.5 (pthread_create.c:660)
==324672==    by 0x10CB9A: thread_create (pipe_util.c:49)
==324672==    by 0x10CDB8: pipe_connect (pipe_util.c:110)
==324672==    by 0x10CE39: pipe_parallel (pipe_util.c:123)
==324672==    by 0x10B9B3: test_parallel_multiplier (pipe_test.c:179)
==324672==    by 0x10CA6D: pipe_run_test_suite (pipe_test.c:450)
==324672==    by 0x10D171: main (main.c:5)
==324672== 
==324672== LEAK SUMMARY:
==324672==    definitely lost: 0 bytes in 0 blocks
==324672==    indirectly lost: 0 bytes in 0 blocks
==324672==      possibly lost: 3,536 bytes in 13 blocks
==324672==    still reachable: 0 bytes in 0 blocks
==324672==         suppressed: 0 bytes in 0 blocks
==324672== 
==324672== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 0 from 0)
@git-blame
Copy link

Note this only occurs in pipe_test.c and/or if you use the utilities functions.

In any case, there is a commit on https://github.com/git-blame/pipe.
This returns thread handles so that in pipe_test.c you can join the child threads and clean up resources.

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

No branches or pull requests

2 participants