uci is currently a highly problematic software and its library & lua
bindings cannot be used without corrupting or leaking memory in the host
process. Every long running process will suffer. The only way to use it
with an acceptable risk is by using the cli interface which throws its
virtual memory region away after its finished.

To notice such problems faster, start the uci testsuite with the
valgrind memory checker.

Signed-off-by: Charlemagne Lasse <charlemagnela...@gmail.com>
---
Bug report: https://bugs.openwrt.org/index.php?do=details&task_id=2288

 test/tests.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/tests.sh b/test/tests.sh
index ee72c31..5312d41 100644
--- a/test/tests.sh
+++ b/test/tests.sh
@@ -11,8 +11,10 @@ UCI_BIN="../uci"
  echo "uci is not present." >&2
  return 1
 }
-UCI="${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR}"
-UCI_Q="${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR} -q"
+CHECKS="--num-callers=25 --track-origins=yes --leak-check=full"
+VALGRIND="valgrind -q --tool=memcheck --error-exitcode=126 ${CHECKS}"
+UCI="${VALGRIND} ${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR}"
+UCI_Q="${VALGRIND} ${UCI_BIN} -c ${CONFIG_DIR} -p ${CHANGES_DIR} -q"

 REF_DIR="./references"
 SCRIPTS_DIR="./tests.d"
-- 
2.11.0

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to