CCExtractor / ccextractor

CCExtractor - Official version maintained by the core team
https://www.ccextractor.org
GNU General Public License v2.0
717 stars 426 forks source link

Memory leaks ! #657

Closed sidgairo18 closed 6 years ago

sidgairo18 commented 7 years ago
  1. Leaked_storage: Variable unescaped going out of scope leaks the storage it points to in file src/lib_ccx/ccx_encoders_webvtt.c , function write_stringz_as_webvtt()
  2. leaked_storage: Returning without freeing context leaks the storage that it points to in file src/lib_ccx/ccx_encoders_common.c function encode_sub()
  3. leaked_storage: Variable epg going out of scope leaks the storage it points to in the file /src/lib_ccx/networking.c function net_send_epg()
  4. leaked_storage: Variable ctx going out of scope leaks the storage it points to in the file src/lib_ccx/lib_ccx.c function init_libraries()
MatejMecka commented 6 years ago

Valgrind tells me those ones are fixed but there are other ones that Valgrind reports for me.

==24760==    by 0x40A53D: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x40B4DA: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x45F377: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x45F66F: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x45FA29: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x43DFAE: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x43EF42: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x40B7D9: paraof_ocrtext (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x4267B1: write_cc_bitmap_as_srt (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x41833C: encode_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x45F496: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x45FA29: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x43DFAE: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x43EF42: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==24760==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
cfsmp3 commented 6 years ago

@MatejMecka we're missing lines there... we need more than just the stack trace... before each of those it must say how much memory was allocated and in which line of code.

MatejMecka commented 6 years ago
==1034== Mismatched free() / delete / delete []
==1034==    at 0x4C2F74B: operator delete[](void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1034==    by 0x40AC21: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==  Address 0x9f98800 is 0 bytes inside a block of size 62 alloc'd
==1034==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1034==    by 0x40A53D: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034== 
==1034== Mismatched free() / delete / delete []
==1034==    at 0x4C2F74B: operator delete[](void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1034==    by 0x40B7D5: paraof_ocrtext (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4267A3: write_cc_bitmap_as_srt (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x41832E: encode_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F474: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==  Address 0x9fab7c0 is 0 bytes inside a block of size 131 alloc'd
==1034==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1034==    by 0x40A82F: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034== 
==1034== Mismatched free() / delete / delete []
==1034==    at 0x4C2F74B: operator delete[](void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1034==    by 0x40A510: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==  Address 0xc2eb7f0 is 0 bytes inside a block of size 65 alloc'd
==1034==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==1034==    by 0x40A53D: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034== 
==1034== Conditional jump or move depends on uninitialised value(s)
==1034==    at 0x51E5DF7: tesseract::Tesseract::quality_based_rejection(PAGE_RES_IT&, unsigned char) (in /usr/lib/libtesseract.so.3.0.4)
==1034==    by 0x51D928A: tesseract::Tesseract::rejection_passes(PAGE_RES*, ETEXT_DESC*, TBOX const*, char const*) (in /usr/lib/libtesseract.so.3.0.4)
==1034==    by 0x51E05D6: tesseract::Tesseract::recog_all_words(PAGE_RES*, ETEXT_DESC*, TBOX const*, char const*, int) (in /usr/lib/libtesseract.so.3.0.4)
==1034==    by 0x51CB064: tesseract::TessBaseAPI::Recognize(ETEXT_DESC*) (in /usr/lib/libtesseract.so.3.0.4)
==1034==    by 0x409575: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034==    by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor)
==1034== 

@cfsmp3

cfsmp3 commented 6 years ago

Run valgrind on the debug version of CCExtractor, otherwise we're missing line numbers and other details we need to fix this.

On Fri, Jan 12, 2018 at 8:54 PM, Matej Plavevski notifications@github.com wrote:

==1034== Mismatched free() / delete / delete [] ==1034== at 0x4C2F74B: operator delete (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1034== by 0x40AC21: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== Address 0x9f98800 is 0 bytes inside a block of size 62 alloc'd ==1034== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1034== by 0x40A53D: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== ==1034== Mismatched free() / delete / delete [] ==1034== at 0x4C2F74B: operator delete (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1034== by 0x40B7D5: paraof_ocrtext (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4267A3: write_cc_bitmap_as_srt (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x41832E: encode_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F474: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== Address 0x9fab7c0 is 0 bytes inside a block of size 131 alloc'd ==1034== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1034== by 0x40A82F: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== ==1034== Mismatched free() / delete / delete [] ==1034== at 0x4C2F74B: operator delete (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1034== by 0x40A510: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== Address 0xc2eb7f0 is 0 bytes inside a block of size 65 alloc'd ==1034== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==1034== by 0x40A53D: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x407F61: main (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== ==1034== Conditional jump or move depends on uninitialised value(s) ==1034== at 0x51E5DF7: tesseract::Tesseract::quality_based_rejection(PAGE_RES_IT&, unsigned char) (in /usr/lib/libtesseract.so.3.0.4) ==1034== by 0x51D928A: tesseract::Tesseract::rejection_passes(PAGE_RES, ETEXT_DESC, TBOX const, char const) (in /usr/lib/libtesseract.so.3.0.4) ==1034== by 0x51E05D6: tesseract::Tesseract::recog_all_words(PAGE_RES, ETEXT_DESC, TBOX const, char const, int) (in /usr/lib/libtesseract.so.3.0.4) ==1034== by 0x51CB064: tesseract::TessBaseAPI::Recognize(ETEXT_DESC*) (in /usr/lib/libtesseract.so.3.0.4) ==1034== by 0x409575: ocr_bitmap (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x40B4D6: ocr_rect (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F355: write_dvb_sub (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45F64D: dvbsub_handle_display_segment (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x45FA07: dvbsub_decode (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43DFA0: process_data (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x43EF34: general_loop (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034== by 0x4071D3: api_start (in /root/GoogleCodein/ccextractor/linux/ccextractor) ==1034==

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CCExtractor/ccextractor/issues/657#issuecomment-357410030, or mute the thread https://github.com/notifications/unsubscribe-auth/AFrJ2WO8eEndiJwxGe_KiaR4iVOSdYx9ks5tKDb4gaJpZM4LqHKI .

MatejMecka commented 6 years ago
==9336== 
==9336== HEAP SUMMARY:
==9336==     in use at exit: 2,238,674 bytes in 16 blocks
==9336==   total heap usage: 65,591 allocs, 65,575 frees, 3,298,974 bytes allocated
==9336== 
==9336== 5 bytes in 1 blocks are still reachable in loss record 1 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x459DB4: init_libraries (lib_ccx.c:124)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== 5 bytes in 1 blocks are still reachable in loss record 2 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x5D93489: strdup (strdup.c:42)
==9336==    by 0x40CF2F: get_file_extension (utility.c:516)
==9336==    by 0x459F90: init_libraries (lib_ccx.c:167)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== 22 bytes in 1 blocks are still reachable in loss record 3 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x42D3DD: append_file_to_queue (params.c:106)
==9336==    by 0x430A3D: parse_parameters (params.c:1141)
==9336==    by 0x407EF8: main (ccextractor.c:584)
==9336== 
==9336== 22 bytes in 1 blocks are still reachable in loss record 4 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x40CE8A: get_basename (utility.c:493)
==9336==    by 0x459B33: init_ctx_outbase (lib_ccx.c:76)
==9336==    by 0x459F72: init_libraries (lib_ccx.c:163)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== 64 bytes in 1 blocks are still reachable in loss record 5 of 16
==9336==    at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x52C5834: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x51C3890: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==9336==    by 0x40107CA: call_init (dl-init.c:30)
==9336==    by 0x40107CA: _dl_init (dl-init.c:120)
==9336==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==9336==    by 0x2: ???
==9336==    by 0xFFF0005BE: ???
==9336==    by 0xFFF0005CC: ???
==9336==    by 0xFFF0005E2: ???
==9336== 
==9336== 80 bytes in 1 blocks are still reachable in loss record 6 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x4C2FDEF: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x42D44E: append_file_to_queue (params.c:113)
==9336==    by 0x430A3D: parse_parameters (params.c:1141)
==9336==    by 0x407EF8: main (ccextractor.c:584)
==9336== 
==9336== 128 bytes in 1 blocks are still reachable in loss record 7 of 16
==9336==    at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x536B959: GlobalParams() (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x51BE91D: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==9336==    by 0x40107CA: call_init (dl-init.c:30)
==9336==    by 0x40107CA: _dl_init (dl-init.c:120)
==9336==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==9336==    by 0x2: ???
==9336==    by 0xFFF0005BE: ???
==9336==    by 0xFFF0005CC: ???
==9336==    by 0xFFF0005E2: ???
==9336== 
==9336== 152 bytes in 1 blocks are still reachable in loss record 8 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x4598F8: init_decoder_setting (lib_ccx.c:15)
==9336==    by 0x459E97: init_libraries (lib_ccx.c:147)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== 188 bytes in 1 blocks are still reachable in loss record 9 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x459FBB: init_libraries (lib_ccx.c:171)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== 256 bytes in 1 blocks are still reachable in loss record 10 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x459DF7: init_libraries (lib_ccx.c:129)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== 352 bytes in 1 blocks are still reachable in loss record 11 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x459BD9: init_libraries (lib_ccx.c:96)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== 512 bytes in 1 blocks are still reachable in loss record 12 of 16
==9336==    at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x520AC04: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x520AEB7: GenericVector<tesseract::IntParam*>::push_back(tesseract::IntParam*) (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x51C0C24: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==9336==    by 0x40107CA: call_init (dl-init.c:30)
==9336==    by 0x40107CA: _dl_init (dl-init.c:120)
==9336==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==9336==    by 0x2: ???
==9336==    by 0xFFF0005BE: ???
==9336==    by 0xFFF0005CC: ???
==9336==    by 0xFFF0005E2: ???
==9336== 
==9336== 1,024 bytes in 1 blocks are still reachable in loss record 13 of 16
==9336==    at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x51ED004: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x51ED107: GenericVector<tesseract::BoolParam*>::push_back(tesseract::BoolParam*) (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x51C25E5: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==9336==    by 0x40107CA: call_init (dl-init.c:30)
==9336==    by 0x40107CA: _dl_init (dl-init.c:120)
==9336==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==9336==    by 0x2: ???
==9336==    by 0xFFF0005BE: ???
==9336==    by 0xFFF0005CC: ???
==9336==    by 0xFFF0005E2: ???
==9336== 
==9336== 1,024 bytes in 1 blocks are still reachable in loss record 14 of 16
==9336==    at 0x4C2E80F: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x52212B4: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x5221357: GenericVector<tesseract::DoubleParam*>::push_back(tesseract::DoubleParam*) (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x51C3DA4: ??? (in /usr/lib/libtesseract.so.3.0.4)
==9336==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==9336==    by 0x40107CA: call_init (dl-init.c:30)
==9336==    by 0x40107CA: _dl_init (dl-init.c:120)
==9336==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==9336==    by 0x2: ???
==9336==    by 0xFFF0005BE: ???
==9336==    by 0xFFF0005CC: ???
==9336==    by 0xFFF0005E2: ???
==9336== 
==9336== 72,704 bytes in 1 blocks are still reachable in loss record 15 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x6378EFF: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==9336==    by 0x40106B9: call_init.part.0 (dl-init.c:72)
==9336==    by 0x40107CA: call_init (dl-init.c:30)
==9336==    by 0x40107CA: _dl_init (dl-init.c:120)
==9336==    by 0x4000C69: ??? (in /lib/x86_64-linux-gnu/ld-2.23.so)
==9336==    by 0x2: ???
==9336==    by 0xFFF0005BE: ???
==9336==    by 0xFFF0005CC: ???
==9336==    by 0xFFF0005E2: ???
==9336== 
==9336== 2,162,136 bytes in 1 blocks are still reachable in loss record 16 of 16
==9336==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==9336==    by 0x440A34: init_demuxer (ccx_demuxer.c:299)
==9336==    by 0x45A064: init_libraries (lib_ccx.c:183)
==9336==    by 0x406E33: api_start (ccextractor.c:61)
==9336==    by 0x407F61: main (ccextractor.c:604)
==9336== 
==9336== LEAK SUMMARY:
==9336==    definitely lost: 0 bytes in 0 blocks
==9336==    indirectly lost: 0 bytes in 0 blocks
==9336==      possibly lost: 0 bytes in 0 blocks
==9336==    still reachable: 2,238,674 bytes in 16 blocks
==9336==         suppressed: 0 bytes in 0 blocks
==9336== 
==9336== For counts of detected and suppressed errors, rerun with: -v
==9336== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Compiled CCExtractor with the -g options and -debug in CCExtractor. I passed to valgrind --leak-check=full --show-leak-kinds=all

cfsmp3 commented 6 years ago

Closing since @sidgairo18 is gone...