Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lavabit/magma.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLadar Levison <ladar@lavabit.com>2020-06-09 16:09:48 +0300
committerLadar Levison <ladar@lavabit.com>2020-06-09 16:09:48 +0300
commit6da5282a82532ed71c2365ebfe11610ed4fbae0e (patch)
tree7962a797f7ba4891e2b814b29b1d805087420ef2
parent34398b60192c917209684ca04646eb7e4b1513a7 (diff)
Updated suppressions. Fixed sample check logic.
-rw-r--r--check/magma/sample_check.c12
-rwxr-xr-xdev/scripts/launch/check.vg.sh1
-rw-r--r--sandbox/etc/magma.suppressions17
3 files changed, 23 insertions, 7 deletions
diff --git a/check/magma/sample_check.c b/check/magma/sample_check.c
index 54b14adf..31057d75 100644
--- a/check/magma/sample_check.c
+++ b/check/magma/sample_check.c
@@ -7,7 +7,7 @@
#include "magma_check.h"
-#define COMPONENT_CHECK_MTHREADS 2
+#define COMPONENT_CHECK_MTHREADS 4
#define COMPONENT_CHECK_ITERATIONS 16
bool_t check_component_test1_sthread(stringer_t *errmsg) {
@@ -62,14 +62,14 @@ bool_t check_component_test2_mthread(stringer_t *errmsg) {
return true;
}
else if (!(threads = mm_alloc(sizeof(pthread_t) * COMPONENT_CHECK_MTHREADS))) {
- st_sprint(errmsg, "Thread allocation failed.");
+ if (errmsg) st_sprint(errmsg, "Thread allocation failed.");
return false;
}
// Launch the threads.
for (uint64_t counter = 0; counter < COMPONENT_CHECK_MTHREADS; counter++) {
if (thread_launch(threads + counter, &check_component_test2_wrap, NULL)) {
- st_sprint(errmsg, "Thread launch failed.");
+ if (errmsg) st_sprint(errmsg, "Thread launch failed.");
result = false;
}
}
@@ -77,11 +77,11 @@ bool_t check_component_test2_mthread(stringer_t *errmsg) {
// Wait for the threads to finish and check the output value for an error indication.
for (uint64_t counter = 0; counter < COMPONENT_CHECK_MTHREADS; counter++) {
if (thread_result(*(threads + counter), &outcome)) {
- if (!errmsg) st_sprint(errmsg, "Thread join error.");
+ if (errmsg) st_sprint(errmsg, "Thread join error.");
result = false;
}
else if ((threads + counter) && outcome) {
- if (!errmsg) st_sprint(errmsg, "Threaded test failed. {%.*s}", st_length_int((stringer_t *)outcome), st_char_get((stringer_t *)outcome));
+ if (errmsg) st_sprint(errmsg, "Threaded test failed. {%.*s}", st_length_int((stringer_t *)outcome), st_char_get((stringer_t *)outcome));
st_free(outcome);
result = false;
}
@@ -96,7 +96,6 @@ START_TEST (check_component_s) {
stringer_t *errmsg = MANAGEDBUF(1024);
if (status()) result = check_component_test1_sthread(errmsg);
- //if (status() && result) result = check_component_test2_sthread(errmsg);
log_test("COMPONENT / INTERFACE / SINGLE THREADED:", errmsg);
ck_assert_msg(result, st_char_get(errmsg));
@@ -108,7 +107,6 @@ START_TEST (check_component_m) {
stringer_t *errmsg = MANAGEDBUF(1024);
if (status()) result = check_component_test2_mthread(errmsg);
- if (status() && result) result = check_component_test2_mthread(errmsg);
log_test("COMPONENT / INTERFACE / MILTI THREADED:", errmsg);
ck_assert_msg(result, st_char_get(errmsg));
diff --git a/dev/scripts/launch/check.vg.sh b/dev/scripts/launch/check.vg.sh
index 2ac0682c..cb9db132 100755
--- a/dev/scripts/launch/check.vg.sh
+++ b/dev/scripts/launch/check.vg.sh
@@ -46,6 +46,7 @@ valgrind --tool=memcheck \
--partial-loads-ok=yes \
--track-fds=yes \
--gen-suppressions=all \
+--suppressions=$MAGMA_DIST/sandbox/etc/magma.suppressions \
$MAGMA_DIST/magmad.check --check $1 $MAGMA_DIST/sandbox/etc/magma.sandbox.config
else
valgrind --tool=memcheck \
diff --git a/sandbox/etc/magma.suppressions b/sandbox/etc/magma.suppressions
index 26e6056c..390037f2 100644
--- a/sandbox/etc/magma.suppressions
+++ b/sandbox/etc/magma.suppressions
@@ -3,6 +3,23 @@
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
+ fun:_dl_scope_free
+ fun:_dl_map_object_deps
+ fun:dl_open_worker
+ fun:_dl_catch_error
+ fun:_dl_open
+ fun:do_dlopen
+ fun:_dl_catch_error
+ fun:dlerror_run
+ fun:__libc_dlopen_mode
+ fun:pthread_cancel_init
+ fun:*
+}
+{
+ <insert_a_suppression_name_here>
+ Memcheck:Leak
+ match-leak-kinds: reachable
+ fun:malloc
fun:local_strdup
fun:expand_dynamic_string_token
fun:_dl_map_object