compyx@asus-p5k:~$ valgrind bin/subsizer "music demo.prg" ==25408== Memcheck, a memory error detector ==25408== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==25408== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info ==25408== Command: bin/subsizer music\ demo.prg ==25408== argv[0] = 'bin/subsizer' argv[1] = 'music demo.prg' build matches... ==25408== Warning: set address range perms: large range [0x395f8040, 0x98bd9040) (undefined) ...0.49 s optimizing matches... ==25408== Conditional jump or move depends on uninitialised value(s) ==25408== at 0x10B6F4: cost_enc (in /home/compyx/bin/subsizer) ==25408== by 0x10C020: crunch_normal_int.isra.1 (in /home/compyx/bin/subsizer) ==25408== by 0x109818: main (in /home/compyx/bin/subsizer) ==25408== 5264 (left 70.84%) 0000113235660150,1112,1010122424555667,222233346666789A,132223234566679C ==25408== Conditional jump or move depends on uninitialised value(s) ==25408== at 0x4C31CC2: __memcmp_sse4_1 (vg_replace_strmem.c:1094) ==25408== by 0x10C4B4: crunch_normal_int.isra.1 (in /home/compyx/bin/subsizer) ==25408== by 0x109818: main (in /home/compyx/bin/subsizer) ==25408== ==25408== Conditional jump or move depends on uninitialised value(s) ==25408== at 0x4C31CFD: __memcmp_sse4_1 (vg_replace_strmem.c:1094) ==25408== by 0x10C4B4: crunch_normal_int.isra.1 (in /home/compyx/bin/subsizer) ==25408== by 0x109818: main (in /home/compyx/bin/subsizer) ==25408== ==25408== Conditional jump or move depends on uninitialised value(s) ==25408== at 0x10C4B7: crunch_normal_int.isra.1 (in /home/compyx/bin/subsizer) ==25408== by 0x109818: main (in /home/compyx/bin/subsizer) ==25408== 4899 (left 65.93%) 0000113235660150,1112,1010122332456667,222323346666789A,132223234566679C 4897 (left 65.90%) 0000113235660150,1112,1010122332456667,222323346666789A,132223234566679C ==25408== Conditional jump or move depends on uninitialised value(s) ==25408== at 0x4C31CD6: __memcmp_sse4_1 (vg_replace_strmem.c:1094) ==25408== by 0x10C4B4: crunch_normal_int.isra.1 (in /home/compyx/bin/subsizer) ==25408== by 0x109818: main (in /home/compyx/bin/subsizer) ==25408== ...2.02 s ==25408== Warning: set address range perms: large range [0x395f8028, 0x98bd9058) (noaccess) generating output... ...0.02 s packed 7431 bytes into 4897 bytes verifed 7431 bytes...ok ==25408== ==25408== HEAP SUMMARY: ==25408== in use at exit: 0 bytes in 0 blocks ==25408== total heap usage: 101 allocs, 101 frees, 1,624,666,687 bytes allocated ==25408== ==25408== All heap blocks were freed -- no leaks are possible ==25408== ==25408== For counts of detected and suppressed errors, rerun with: -v ==25408== Use --track-origins=yes to see where uninitialised values come from ==25408== ERROR SUMMARY: 6 errors from 5 contexts (suppressed: 0 from 0)
index 6012af5..55f85ab 100644 --- a/crunch/subsizer/src/crunch_normal.c +++ b/crunch/subsizer/src/crunch_normal.c @@ -485,7 +485,7 @@ static int crunch_normal_int(Buffer *sbf, Buffer *dbf, int flags) MatchTree *mt = create_matchtree(); double t1, t2; EncodingSet es; - + memset(&es, 0, sizeof(EncodingSet)); msg(MSG_VERBOSE, "build matches...\n"); t1 = get_time();
tlr@pinecone:subsizer$ valgrind subsizer -x "tests/Ninth.prg" ==13935== Memcheck, a memory error detector ==13935== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==13935== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==13935== Command: subsizer -x tests/Ninth.prg ==13935== read 'tests/Ninth.prg' $0801-$7400. detected sys: $4000 build matches... ==13935== Warning: set address range perms: large range [0x3a048040, 0x99629040) (undefined) ...6.48 s optimizing matches... 7139 (left 25.82%) 1110334466621000,1012,0000001022345657,02112344560678AD,02103434555789AF 6677 (left 24.15%) 1110334465462410,1012,0000001022345657,02112344560678AD,02103434555789AF 6682 (left 24.17%) 1110334465462410,1012,0000001022345657,02112344560678AD,02103434555789AF ...6.69 s ==13935== Warning: set address range perms: large range [0x3a048028, 0x99629058) (noaccess) generating output... ...0.02 s safe = 2 packed 27647 bytes (109 blocks) into 6974 bytes (28 blocks) ==13935== ==13935== HEAP SUMMARY: ==13935== in use at exit: 0 bytes in 0 blocks ==13935== total heap usage: 100 allocs, 100 frees, 1,624,919,704 bytes allocated ==13935== ==13935== All heap blocks were freed -- no leaks are possible ==13935== ==13935== For counts of detected and suppressed errors, rerun with: -v ==13935== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) tlr@pinecone:subsizer$
safe_malloc(200000000 * sizeof(Match), "matches");