diff --git a/analysis/datastub/export.py b/analysis/datastub/export.py index 7f21ff32..adcd4a5b 100644 --- a/analysis/datastub/export.py +++ b/analysis/datastub/export.py @@ -216,7 +216,11 @@ def search_in_directory(filename, filepath): # Download source package command = f"apt-get source {package}" debug(4, f"exec: {command}") - subprocess.check_output(shlex.split(command)) + try: + subprocess.check_output(shlex.split(command)) + except subprocess.CalledProcessError: + debug(0, f"Download sources failed for {package}") + return None, 0 DOWNLOADED_PACKAGE_SOURCES.append(bin_file_path) diff --git a/cryptolib/.gitignore b/cryptolib/.gitignore index a6903d20..b9698d14 100644 --- a/cryptolib/.gitignore +++ b/cryptolib/.gitignore @@ -1 +1,6 @@ -test_results +# Ignore everything +/* + +# Except for DATA general directories +!common/ +!selftest-*/ diff --git a/cryptolib/selftest-heap.sh b/cryptolib/selftest-heap.sh index 3bc63394..6b81b56f 100755 --- a/cryptolib/selftest-heap.sh +++ b/cryptolib/selftest-heap.sh @@ -2,8 +2,8 @@ set -e -# OPTIONS="--phase1 --phase2 --export --parallel" -OPTIONS="--phase1" +OPTIONS="--phase1 --phase2 --export --parallel" +# OPTIONS="--phase1" export RESULTDIR=${PWD}/results cd selftest-heap diff --git a/cryptolib/selftest-heap/dmt-realloc.c b/cryptolib/selftest-heap/dmt-realloc.c index 537565d4..beb4c246 100644 --- a/cryptolib/selftest-heap/dmt-realloc.c +++ b/cryptolib/selftest-heap/dmt-realloc.c @@ -54,7 +54,7 @@ int change(uint16_t number, void** obj); int readaddr(void** addr, uint16_t number); int test(uint16_t number, uint8_t key); #ifdef DEBUG -void printstats(uint16_t number, void** obj); +void printstats(uint16_t number, vector> obj); void printaddr(uint16_t number, void** addr); #endif @@ -386,12 +386,12 @@ int readaddr(void** addr, uint16_t number) * @param number number of objects * @param obj array containing objects */ -void printstats(uint16_t number, void** obj) +void printstats(uint16_t number, vector> obj) { /* total memory */ - struct mallinfo mi = mallinfo(); - printf("*******************************\n"); - printf("Allocated bytes: %d\n", mi.arena); + // struct mallinfo mi = mallinfo(); + // printf("*******************************\n"); + // printf("Allocated bytes: %d\n", mi.arena); /* objects entries */ int i; @@ -416,9 +416,9 @@ void printaddr(uint16_t number, void** addr) printf("*******************************\n"); printf("Addresses:\n"); int i; - for (i = 0; i < number; i++) { - printf(" %0*"PRIxPTR"\n", (int)(sizeof(void*) * 2), (uintptr_t)addr[i]); - } + // for (i = 0; i < number; i++) { + // printf(" %0*" PRIxPTR "\n", (int)(sizeof(void*) * 2), (uintptr_t)addr[i]); + // } } #endif diff --git a/cryptolib/selftest-heap/framework.sh b/cryptolib/selftest-heap/framework.sh index 1e191d9f..bb22d84e 100755 --- a/cryptolib/selftest-heap/framework.sh +++ b/cryptolib/selftest-heap/framework.sh @@ -94,7 +94,7 @@ function cb_pre_run { # # $1 ... key file name function cb_run_command { - echo "${BINARY} 0 0 0 16 $1" + echo "${BINARY} 1 0 1 16 $1" } # DATA callback for custom commands that are executed immediately after diff --git a/pintool/addrtrace.cpp b/pintool/addrtrace.cpp index b5e7c451..18ea55d2 100644 --- a/pintool/addrtrace.cpp +++ b/pintool/addrtrace.cpp @@ -1284,7 +1284,8 @@ void dofree(ADDRINT addr) { PT_DEBUG(1, "dofree 0x" << std::hex << addr); if (!addr) { - PT_ERROR("dofree called with NULL"); + PT_DEBUG(3, "dofree called with NULL"); + return; } if (allocmap.find(addr) == allocmap.end()) {