← cproj

refactor tup, add config files

a6641714038b99e935398a935a1d7687069dc257 · Ovidiu · Aug 31, 2020 20:17

+494 −262 · 12 files changed

  • sdstest/Tuprules.tup +34 −23
  • sdstest/bin/Tupfile +2 −2
  • sdstest/build-debug/test/program_debug.txt +231 −0
  • sdstest/build-debug/tup.config +1 −0
  • sdstest/build-release/test/program_release.txt +215 −0
  • sdstest/build-release/tup.config +1 −0
  • sdstest/lib/Tupfile +5 −2
  • sdstest/obj/Tupfile +3 −3
  • sdstest/test/program_debug.txt +0 −231
  • sdstest/tup-configs/debug.config +1 −0
  • sdstest/tup-configs/release.config +1 −0
  • sdstest/tup.config +0 −1
diff --git a/sdstest/Tuprules.tup b/sdstest/Tuprules.tup
index 2c55156..2132093 100644
--- a/sdstest/Tuprules.tup
+++ b/sdstest/Tuprules.tup
@@ -1,19 +1,10 @@
 &includedir  = include/
 &objdir  = obj/
 &bindir  = bin/
-&libdir  = lib/sds/
+&libdir  = lib/
 
-CDEBUG += -Weverything
-CDEBUG += -g
-CDEBUG += -Og
-CDEBUG += -ggdb
-#CDEBUG += -v
-
-CRELEASE += -O2
-CRELEASE += -D_FORTIFY_SOURCE=2
-CRELEASE += -fexceptions
-CRELEASE += -fvisibility=hidden
-CRELEASE += -Werror
+IQT += -iquote../lib
+IQT += -iquote../include
 
 VALGRND  += --leak-check=full
 VALGRND  += --show-leak-kinds=all
@@ -21,20 +12,40 @@ VALGRND  += --track-origins=yes
 VALGRND  += --verbose
 VALGRND  += --log-file=
 
-ifeq (@(DO_RELEASE),y)
-  # Create object files - preprocess, compile and assemble steps
-!ccorel = |> clang $(CRELEASE) -I&(includedir) -c %f -o &(objdir)/%o |> %B_release.o
-  # macro for the archive command
-!ar = |> ar crs %o %f |>
-  # Do binaries, debug and release 
-!ccbrel = |> clang $(CRELEASE) %f -o &(bindir)/%o |> %B
+ifeq (@(BUILD_TYPE),debug)
+# debug build:
+  CDEBUG += -Weverything
+  CDEBUG += -g
+  CDEBUG += -Og
+  CDEBUG += -ggdb
+# Do the object files
+  !cc = |> clang $(CDEBUG) $(IQT) -c %f -o &(objdir)/%o  |> %B_debug.o
+#  !cc2 = |> clang $(CDEBUG) -v -c %f -o %o  |> %B_debug.o
+# macro for the archive command
+  !ar = |> ar crs %o %f |> 
+# Make binaries, debug and release 
+  !ccb = |> clang $(CDEBUG) %f -o &(bindir)/%o |> %B
 else
-  # Do the object files
-!ccodbg = |> clang $(CDEBUG) -iquote../lib -iquote../include  -c %f -o &(objdir)/%o  |> %B_debug.o
+  ifeq (@(BUILD_TYPE),release)
+  # release build
+  CRELEASE += -O2
+  CRELEASE += -D_FORTIFY_SOURCE=2
+  CRELEASE += -fexceptions
+  CRELEASE += -fvisibility=hidden
+  CRELEASE += -Werror
+  # Create object files - preprocess, compile and assemble steps
+    !cc = |> clang $(CRELEASE) $(IQT) -c %f -o &(objdir)/%o |> %B_release.o
   # macro for the archive command
-!ar = |> ar crs %o %f |>
+    !ar = |> ar crs %o %f |>
   # Do binaries, debug and release 
-!ccbdbg = |> clang $(CDEBUG) %f -o &(bindir)/%o |> %B
+    !ccb = |> clang $(CRELEASE) %f -o &(bindir)/%o |> %B
+  else
+    ifeq (@(BUILD_TYPE),static)
+      : |> echo static |>
+    else
+      error "Build type not set or wrong!"
+    endif
+  endif
 endif
 
 # Valgrind the binaries
diff --git a/sdstest/bin/Tupfile b/sdstest/bin/Tupfile
index c8224b3..ec42a48 100644
--- a/sdstest/bin/Tupfile
+++ b/sdstest/bin/Tupfile
@@ -15,5 +15,5 @@ include_rules
 #: ../lib/mylib.a |> clang %f -v -o %o  |> %B
 # make {bin} placeholder
 #: foreach ../lib/*.a |> clang %f -v -o %o |> program
-: foreach ../lib/*_debug.a |> !ccbdbg |> program_debug
-: foreach ../lib/*_release.a |> !ccbrel  |> program_release
+: foreach ../lib/*_debug.a |> !ccb |> program_debug
+: foreach ../lib/*_release.a |> !ccb  |> program_release
diff --git a/sdstest/build-debug/test/program_debug.txt b/sdstest/build-debug/test/program_debug.txt
new file mode 100644
index 0000000..037ec4d
--- /dev/null
+++ b/sdstest/build-debug/test/program_debug.txt
@@ -0,0 +1,231 @@
+==112876== Memcheck, a memory error detector
+==112876== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
+==112876== Using Valgrind-3.16.1-36d6727e1d-20200622X and LibVEX; rerun with -h for copyright info
+==112876== Command: ../bin/program_debug
+==112876== Parent PID: 112864
+==112876== 
+--112876-- 
+--112876-- Valgrind options:
+--112876--    --leak-check=full
+--112876--    --show-leak-kinds=all
+--112876--    --track-origins=yes
+--112876--    --verbose
+--112876--    --log-file=program_debug.txt
+--112876-- Contents of /proc/version:
+--112876--   Linux version 5.8.5-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Thu, 27 Aug 2020 18:53:02 +0000
+--112876-- 
+--112876-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand
+--112876-- Page sizes: currently 4096, max supported 4096
+--112876-- Valgrind library directory: /usr/lib/valgrind
+--112876-- Reading syms from /home/kiro/proj/cproj/sdstest/build-debug/bin/program_debug
+--112876-- Reading syms from /usr/lib/ld-2.32.so
+--112876-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
+--112876--    object doesn't have a dynamic symbol table
+--112876-- Scheduler: using generic scheduler lock implementation.
+--112876-- Reading suppressions file: /usr/lib/valgrind/default.supp
+==112876== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-112876-by-???-on-???
+==112876== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-112876-by-???-on-???
+==112876== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-112876-by-???-on-???
+==112876== 
+==112876== TO CONTROL THIS PROCESS USING vgdb (which you probably
+==112876== don't want to do, unless you know exactly what you're doing,
+==112876== or are doing some strange experiment):
+==112876==   /usr/lib/valgrind/../../bin/vgdb --pid=112876 ...command...
+==112876== 
+==112876== TO DEBUG THIS PROCESS USING GDB: start GDB like this
+==112876==   /path/to/gdb ../bin/program_debug
+==112876== and then give GDB the following command
+==112876==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=112876
+==112876== --pid is optional if only one valgrind process is running
+==112876== 
+--112876-- REDIR: 0x4021ee0 (ld-linux-x86-64.so.2:strlen) redirected to 0x580b9662 (vgPlain_amd64_linux_REDIR_FOR_strlen)
+--112876-- REDIR: 0x4021cb0 (ld-linux-x86-64.so.2:index) redirected to 0x580b967c (vgPlain_amd64_linux_REDIR_FOR_index)
+--112876-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
+--112876-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
+==112876== WARNING: new redirection conflicts with existing -- ignoring it
+--112876--     old: 0x04021ee0 (strlen              ) R-> (0000.0) 0x580b9662 vgPlain_amd64_linux_REDIR_FOR_strlen
+--112876--     new: 0x04021ee0 (strlen              ) R-> (2007.0) 0x0483dd90 strlen
+--112876-- REDIR: 0x401e6c0 (ld-linux-x86-64.so.2:strcmp) redirected to 0x483ec60 (strcmp)
+--112876-- REDIR: 0x4022440 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4842450 (mempcpy)
+--112876-- Reading syms from /usr/lib/libc-2.32.so
+--112876-- REDIR: 0x492a8c0 (libc.so.6:memmove) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929db0 (libc.so.6:strncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492ac00 (libc.so.6:strcasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929850 (libc.so.6:strcat) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929e10 (libc.so.6:rindex) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492bfb0 (libc.so.6:rawmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4944500 (libc.so.6:wmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4944040 (libc.so.6:wcscmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492aa20 (libc.so.6:mempcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492a850 (libc.so.6:bcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929d40 (libc.so.6:strncmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929900 (libc.so.6:strcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492a990 (libc.so.6:memset) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4944000 (libc.so.6:wcschr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929ca0 (libc.so.6:strnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x49299e0 (libc.so.6:strcspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492ac50 (libc.so.6:strncasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929980 (libc.so.6:strcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492ada0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4945750 (libc.so.6:wcsnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4944080 (libc.so.6:wcscpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929e50 (libc.so.6:strpbrk) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x49298b0 (libc.so.6:index) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929c60 (libc.so.6:strlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x49303a0 (libc.so.6:memrchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492aca0 (libc.so.6:strcasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492a810 (libc.so.6:memchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4944150 (libc.so.6:wcslen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x4929f80 (libc.so.6:strspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492aba0 (libc.so.6:stpncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492ab40 (libc.so.6:stpcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492bff0 (libc.so.6:strchrnul) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x492acf0 (libc.so.6:strncasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112876-- REDIR: 0x49fc8a0 (libc.so.6:__strrchr_avx2) redirected to 0x483d7d0 (rindex)
+--112876-- REDIR: 0x49fca70 (libc.so.6:__strlen_avx2) redirected to 0x483dc70 (strlen)
+--112876-- REDIR: 0x4925c90 (libc.so.6:malloc) redirected to 0x483a710 (malloc)
+--112876-- REDIR: 0x49ffa80 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x48414b0 (memmove)
+--112876-- REDIR: 0x49262f0 (libc.so.6:free) redirected to 0x483b940 (free)
+--112876-- REDIR: 0x49fc6b0 (libc.so.6:__strchrnul_avx2) redirected to 0x4841f40 (strchrnul)
+--112876-- REDIR: 0x49ffa60 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4842050 (mempcpy)
+==112876== Invalid read of size 1
+==112876==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
+==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== Invalid read of size 1
+==112876==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
+==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== Invalid read of size 1
+==112876==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
+==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== Invalid read of size 1
+==112876==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
+==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== 
+==112876== HEAP SUMMARY:
+==112876==     in use at exit: 0 bytes in 0 blocks
+==112876==   total heap usage: 2 allocs, 2 frees, 4,110 bytes allocated
+==112876== 
+==112876== All heap blocks were freed -- no leaks are possible
+==112876== 
+==112876== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
+==112876== 
+==112876== 1 errors in context 1 of 4:
+==112876== Invalid read of size 1
+==112876==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
+==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== 
+==112876== 5 errors in context 2 of 4:
+==112876== Invalid read of size 1
+==112876==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
+==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== 
+==112876== 7 errors in context 3 of 4:
+==112876== Invalid read of size 1
+==112876==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
+==112876==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112876==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== 
+==112876== 12 errors in context 4 of 4:
+==112876== Invalid read of size 1
+==112876==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
+==112876==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112876==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
+==112876==    by 0x1092B7: main (main.c:18)
+==112876==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
+==112876==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112876==    by 0x10952E: sdsfree (sds.c:167)
+==112876==    by 0x109289: main (main.c:15)
+==112876==  Block was alloc'd at
+==112876==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112876==    by 0x10935B: sdsnewlen (sds.c:99)
+==112876==    by 0x10949F: sdsnew (sds.c:156)
+==112876==    by 0x109276: main (main.c:13)
+==112876== 
+==112876== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
diff --git a/sdstest/build-debug/tup.config b/sdstest/build-debug/tup.config
new file mode 120000
index 0000000..84c56af
--- /dev/null
+++ b/sdstest/build-debug/tup.config
@@ -0,0 +1 @@
+../tup-configs/debug.config
\ No newline at end of file
diff --git a/sdstest/build-release/test/program_release.txt b/sdstest/build-release/test/program_release.txt
new file mode 100644
index 0000000..8ee8089
--- /dev/null
+++ b/sdstest/build-release/test/program_release.txt
@@ -0,0 +1,215 @@
+==112998== Memcheck, a memory error detector
+==112998== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
+==112998== Using Valgrind-3.16.1-36d6727e1d-20200622X and LibVEX; rerun with -h for copyright info
+==112998== Command: ../bin/program_release
+==112998== Parent PID: 112987
+==112998== 
+--112998-- 
+--112998-- Valgrind options:
+--112998--    --leak-check=full
+--112998--    --show-leak-kinds=all
+--112998--    --track-origins=yes
+--112998--    --verbose
+--112998--    --log-file=program_release.txt
+--112998-- Contents of /proc/version:
+--112998--   Linux version 5.8.5-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Thu, 27 Aug 2020 18:53:02 +0000
+--112998-- 
+--112998-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand
+--112998-- Page sizes: currently 4096, max supported 4096
+--112998-- Valgrind library directory: /usr/lib/valgrind
+--112998-- Reading syms from /home/kiro/proj/cproj/sdstest/build-release/bin/program_release
+--112998-- Reading syms from /usr/lib/ld-2.32.so
+--112998-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
+--112998--    object doesn't have a dynamic symbol table
+--112998-- Scheduler: using generic scheduler lock implementation.
+--112998-- Reading suppressions file: /usr/lib/valgrind/default.supp
+==112998== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-112998-by-???-on-???
+==112998== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-112998-by-???-on-???
+==112998== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-112998-by-???-on-???
+==112998== 
+==112998== TO CONTROL THIS PROCESS USING vgdb (which you probably
+==112998== don't want to do, unless you know exactly what you're doing,
+==112998== or are doing some strange experiment):
+==112998==   /usr/lib/valgrind/../../bin/vgdb --pid=112998 ...command...
+==112998== 
+==112998== TO DEBUG THIS PROCESS USING GDB: start GDB like this
+==112998==   /path/to/gdb ../bin/program_release
+==112998== and then give GDB the following command
+==112998==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=112998
+==112998== --pid is optional if only one valgrind process is running
+==112998== 
+--112998-- REDIR: 0x4021ee0 (ld-linux-x86-64.so.2:strlen) redirected to 0x580b9662 (vgPlain_amd64_linux_REDIR_FOR_strlen)
+--112998-- REDIR: 0x4021cb0 (ld-linux-x86-64.so.2:index) redirected to 0x580b967c (vgPlain_amd64_linux_REDIR_FOR_index)
+--112998-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
+--112998-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
+==112998== WARNING: new redirection conflicts with existing -- ignoring it
+--112998--     old: 0x04021ee0 (strlen              ) R-> (0000.0) 0x580b9662 vgPlain_amd64_linux_REDIR_FOR_strlen
+--112998--     new: 0x04021ee0 (strlen              ) R-> (2007.0) 0x0483dd90 strlen
+--112998-- REDIR: 0x401e6c0 (ld-linux-x86-64.so.2:strcmp) redirected to 0x483ec60 (strcmp)
+--112998-- REDIR: 0x4022440 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4842450 (mempcpy)
+--112998-- Reading syms from /usr/lib/libc-2.32.so
+--112998-- REDIR: 0x492a8c0 (libc.so.6:memmove) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929db0 (libc.so.6:strncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492ac00 (libc.so.6:strcasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929850 (libc.so.6:strcat) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929e10 (libc.so.6:rindex) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492bfb0 (libc.so.6:rawmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4944500 (libc.so.6:wmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4944040 (libc.so.6:wcscmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492aa20 (libc.so.6:mempcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492a850 (libc.so.6:bcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929d40 (libc.so.6:strncmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929900 (libc.so.6:strcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492a990 (libc.so.6:memset) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4944000 (libc.so.6:wcschr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929ca0 (libc.so.6:strnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x49299e0 (libc.so.6:strcspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492ac50 (libc.so.6:strncasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929980 (libc.so.6:strcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492ada0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4945750 (libc.so.6:wcsnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4944080 (libc.so.6:wcscpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929e50 (libc.so.6:strpbrk) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x49298b0 (libc.so.6:index) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929c60 (libc.so.6:strlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x49303a0 (libc.so.6:memrchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492aca0 (libc.so.6:strcasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492a810 (libc.so.6:memchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4944150 (libc.so.6:wcslen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x4929f80 (libc.so.6:strspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492aba0 (libc.so.6:stpncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492ab40 (libc.so.6:stpcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492bff0 (libc.so.6:strchrnul) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x492acf0 (libc.so.6:strncasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
+--112998-- REDIR: 0x49fc8a0 (libc.so.6:__strrchr_avx2) redirected to 0x483d7d0 (rindex)
+--112998-- REDIR: 0x49fc6b0 (libc.so.6:__strchrnul_avx2) redirected to 0x4841f40 (strchrnul)
+--112998-- REDIR: 0x49ffa60 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4842050 (mempcpy)
+--112998-- REDIR: 0x49fca70 (libc.so.6:__strlen_avx2) redirected to 0x483dc70 (strlen)
+--112998-- REDIR: 0x4925c90 (libc.so.6:malloc) redirected to 0x483a710 (malloc)
+--112998-- REDIR: 0x49ffa80 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x48414b0 (memmove)
+--112998-- REDIR: 0x49262f0 (libc.so.6:free) redirected to 0x483b940 (free)
+==112998== Invalid read of size 1
+==112998==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
+==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== Invalid read of size 1
+==112998==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
+==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== Invalid read of size 1
+==112998==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
+==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== Invalid read of size 1
+==112998==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
+==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== 
+==112998== HEAP SUMMARY:
+==112998==     in use at exit: 0 bytes in 0 blocks
+==112998==   total heap usage: 2 allocs, 2 frees, 4,110 bytes allocated
+==112998== 
+==112998== All heap blocks were freed -- no leaks are possible
+==112998== 
+==112998== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
+==112998== 
+==112998== 1 errors in context 1 of 4:
+==112998== Invalid read of size 1
+==112998==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
+==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== 
+==112998== 5 errors in context 2 of 4:
+==112998== Invalid read of size 1
+==112998==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
+==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== 
+==112998== 7 errors in context 3 of 4:
+==112998== Invalid read of size 1
+==112998==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
+==112998==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
+==112998==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== 
+==112998== 12 errors in context 4 of 4:
+==112998== Invalid read of size 1
+==112998==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
+==112998==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
+==112998==    by 0x49A80A2: __fprintf_chk (in /usr/lib/libc-2.32.so)
+==112998==    by 0x1092DC: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
+==112998==    at 0x483B9AB: free (vg_replace_malloc.c:538)
+==112998==    by 0x1092A4: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==  Block was alloc'd at
+==112998==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
+==112998==    by 0x109381: sdsnewlen (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998==    by 0x109283: main (in /home/kiro/proj/cproj/sdstest/build-release/bin/program_release)
+==112998== 
+==112998== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
diff --git a/sdstest/build-release/tup.config b/sdstest/build-release/tup.config
new file mode 120000
index 0000000..98b9f34
--- /dev/null
+++ b/sdstest/build-release/tup.config
@@ -0,0 +1 @@
+../tup-configs/release.config
\ No newline at end of file
diff --git a/sdstest/lib/Tupfile b/sdstest/lib/Tupfile
index 9425856..dbcbb01 100644
--- a/sdstest/lib/Tupfile
+++ b/sdstest/lib/Tupfile
@@ -6,5 +6,8 @@ include_rules
 #: foreach ../obj/*.o |> !ar |> %B.a {obj}
 # not foreach .. for all object files into a single archive - for now not .so file
 #: foreach ../obj/*.o |> !ar |> 
-: ../obj/*_debug.o |> !ar |> mylib_debug.a
-: ../obj/*_release.o |> !ar |> mylib_release.a
+# try variants -- variant 1
+#: ../obj/*_debug.o |> !ar |> mylib_debug.a
+#: ../obj/*_release.o |> !ar |> mylib_release.a
+# 2nd variant - set the archive to the build type
+: ../obj/*.o |> !ar |> mylib_@(BUILD_TYPE).a
diff --git a/sdstest/obj/Tupfile b/sdstest/obj/Tupfile
index ca61510..b20e203 100644
--- a/sdstest/obj/Tupfile
+++ b/sdstest/obj/Tupfile
@@ -7,8 +7,8 @@ include_rules
 
 
 ifeq (@(DO_RELEASE),y)
-: foreach ../src/*.c |> !ccorel |>
+: foreach ../src/*.c |> !cc |>
 else
-: foreach ../src/*.c |> !ccodbg |>
-: foreach ../lib/sds/*.c |> !ccodbg |> 
+: foreach ../src/*.c |> !cc |>
+: foreach ../lib/sds/*.c |> !cc |> 
 endif
diff --git a/sdstest/test/program_debug.txt b/sdstest/test/program_debug.txt
deleted file mode 100644
index 9f8d005..0000000
--- a/sdstest/test/program_debug.txt
+++ /dev/null
@@ -1,231 +0,0 @@
-==88929== Memcheck, a memory error detector
-==88929== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
-==88929== Using Valgrind-3.16.1-36d6727e1d-20200622X and LibVEX; rerun with -h for copyright info
-==88929== Command: ../bin/program_debug
-==88929== Parent PID: 88916
-==88929== 
---88929-- 
---88929-- Valgrind options:
---88929--    --leak-check=full
---88929--    --show-leak-kinds=all
---88929--    --track-origins=yes
---88929--    --verbose
---88929--    --log-file=program_debug.txt
---88929-- Contents of /proc/version:
---88929--   Linux version 5.8.5-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Thu, 27 Aug 2020 18:53:02 +0000
---88929-- 
---88929-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-ssse3-avx-avx2-bmi-f16c-rdrand
---88929-- Page sizes: currently 4096, max supported 4096
---88929-- Valgrind library directory: /usr/lib/valgrind
---88929-- Reading syms from /home/kiro/proj/cproj/sdstest/bin/program_debug
---88929-- Reading syms from /usr/lib/ld-2.32.so
---88929-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
---88929--    object doesn't have a dynamic symbol table
---88929-- Scheduler: using generic scheduler lock implementation.
---88929-- Reading suppressions file: /usr/lib/valgrind/default.supp
-==88929== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-88929-by-???-on-???
-==88929== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-88929-by-???-on-???
-==88929== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-88929-by-???-on-???
-==88929== 
-==88929== TO CONTROL THIS PROCESS USING vgdb (which you probably
-==88929== don't want to do, unless you know exactly what you're doing,
-==88929== or are doing some strange experiment):
-==88929==   /usr/lib/valgrind/../../bin/vgdb --pid=88929 ...command...
-==88929== 
-==88929== TO DEBUG THIS PROCESS USING GDB: start GDB like this
-==88929==   /path/to/gdb ../bin/program_debug
-==88929== and then give GDB the following command
-==88929==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=88929
-==88929== --pid is optional if only one valgrind process is running
-==88929== 
---88929-- REDIR: 0x4021ee0 (ld-linux-x86-64.so.2:strlen) redirected to 0x580b9662 (vgPlain_amd64_linux_REDIR_FOR_strlen)
---88929-- REDIR: 0x4021cb0 (ld-linux-x86-64.so.2:index) redirected to 0x580b967c (vgPlain_amd64_linux_REDIR_FOR_index)
---88929-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
---88929-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
-==88929== WARNING: new redirection conflicts with existing -- ignoring it
---88929--     old: 0x04021ee0 (strlen              ) R-> (0000.0) 0x580b9662 vgPlain_amd64_linux_REDIR_FOR_strlen
---88929--     new: 0x04021ee0 (strlen              ) R-> (2007.0) 0x0483dd90 strlen
---88929-- REDIR: 0x401e6c0 (ld-linux-x86-64.so.2:strcmp) redirected to 0x483ec60 (strcmp)
---88929-- REDIR: 0x4022440 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4842450 (mempcpy)
---88929-- Reading syms from /usr/lib/libc-2.32.so
---88929-- REDIR: 0x492a8c0 (libc.so.6:memmove) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929db0 (libc.so.6:strncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492ac00 (libc.so.6:strcasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929850 (libc.so.6:strcat) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929e10 (libc.so.6:rindex) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492bfb0 (libc.so.6:rawmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4944500 (libc.so.6:wmemchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4944040 (libc.so.6:wcscmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492aa20 (libc.so.6:mempcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492a850 (libc.so.6:bcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929d40 (libc.so.6:strncmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929900 (libc.so.6:strcmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492a990 (libc.so.6:memset) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4944000 (libc.so.6:wcschr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929ca0 (libc.so.6:strnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x49299e0 (libc.so.6:strcspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492ac50 (libc.so.6:strncasecmp) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929980 (libc.so.6:strcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492ada0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4945750 (libc.so.6:wcsnlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4944080 (libc.so.6:wcscpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929e50 (libc.so.6:strpbrk) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x49298b0 (libc.so.6:index) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929c60 (libc.so.6:strlen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x49303a0 (libc.so.6:memrchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492aca0 (libc.so.6:strcasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492a810 (libc.so.6:memchr) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4944150 (libc.so.6:wcslen) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x4929f80 (libc.so.6:strspn) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492aba0 (libc.so.6:stpncpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492ab40 (libc.so.6:stpcpy) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492bff0 (libc.so.6:strchrnul) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x492acf0 (libc.so.6:strncasecmp_l) redirected to 0x48301c0 (_vgnU_ifunc_wrapper)
---88929-- REDIR: 0x49fc8a0 (libc.so.6:__strrchr_avx2) redirected to 0x483d7d0 (rindex)
---88929-- REDIR: 0x49fca70 (libc.so.6:__strlen_avx2) redirected to 0x483dc70 (strlen)
---88929-- REDIR: 0x4925c90 (libc.so.6:malloc) redirected to 0x483a710 (malloc)
---88929-- REDIR: 0x49ffa80 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x48414b0 (memmove)
---88929-- REDIR: 0x49262f0 (libc.so.6:free) redirected to 0x483b940 (free)
---88929-- REDIR: 0x49fc6b0 (libc.so.6:__strchrnul_avx2) redirected to 0x4841f40 (strchrnul)
---88929-- REDIR: 0x49ffa60 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4842050 (mempcpy)
-==88929== Invalid read of size 1
-==88929==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
-==88929==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== Invalid read of size 1
-==88929==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
-==88929==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== Invalid read of size 1
-==88929==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
-==88929==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==88929==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== Invalid read of size 1
-==88929==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
-==88929==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==88929==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== 
-==88929== HEAP SUMMARY:
-==88929==     in use at exit: 0 bytes in 0 blocks
-==88929==   total heap usage: 2 allocs, 2 frees, 4,110 bytes allocated
-==88929== 
-==88929== All heap blocks were freed -- no leaks are possible
-==88929== 
-==88929== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
-==88929== 
-==88929== 1 errors in context 1 of 4:
-==88929== Invalid read of size 1
-==88929==    at 0x483DC72: strlen (vg_replace_strmem.c:459)
-==88929==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a66041 is 1 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== 
-==88929== 5 errors in context 2 of 4:
-==88929== Invalid read of size 1
-==88929==    at 0x48420DE: mempcpy (vg_replace_strmem.c:1536)
-==88929==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==88929==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a6604a is 10 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== 
-==88929== 7 errors in context 3 of 4:
-==88929== Invalid read of size 1
-==88929==    at 0x48420D0: mempcpy (vg_replace_strmem.c:1536)
-==88929==    by 0x491B8D1: _IO_file_xsputn@@GLIBC_2.2.5 (in /usr/lib/libc-2.32.so)
-==88929==    by 0x490780A: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a6604c is 12 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== 
-==88929== 12 errors in context 4 of 4:
-==88929== Invalid read of size 1
-==88929==    at 0x483DC84: strlen (vg_replace_strmem.c:459)
-==88929==    by 0x4907AB7: __vfprintf_internal (in /usr/lib/libc-2.32.so)
-==88929==    by 0x48F2AE9: fprintf (in /usr/lib/libc-2.32.so)
-==88929==    by 0x1092B7: main (main.c:18)
-==88929==  Address 0x4a66042 is 2 bytes inside a block of size 14 free'd
-==88929==    at 0x483B9AB: free (vg_replace_malloc.c:538)
-==88929==    by 0x10952E: sdsfree (sds.c:167)
-==88929==    by 0x109289: main (main.c:15)
-==88929==  Block was alloc'd at
-==88929==    at 0x483A77F: malloc (vg_replace_malloc.c:307)
-==88929==    by 0x10935B: sdsnewlen (sds.c:99)
-==88929==    by 0x10949F: sdsnew (sds.c:156)
-==88929==    by 0x109276: main (main.c:13)
-==88929== 
-==88929== ERROR SUMMARY: 25 errors from 4 contexts (suppressed: 0 from 0)
diff --git a/sdstest/tup-configs/debug.config b/sdstest/tup-configs/debug.config
new file mode 100644
index 0000000..3ac8c3d
--- /dev/null
+++ b/sdstest/tup-configs/debug.config
@@ -0,0 +1 @@
+CONFIG_BUILD_TYPE=debug
diff --git a/sdstest/tup-configs/release.config b/sdstest/tup-configs/release.config
new file mode 100644
index 0000000..ef47cea
--- /dev/null
+++ b/sdstest/tup-configs/release.config
@@ -0,0 +1 @@
+CONFIG_BUILD_TYPE=release
diff --git a/sdstest/tup.config b/sdstest/tup.config
deleted file mode 100644
index 30dc56e..0000000
--- a/sdstest/tup.config
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_DO_RELEASE=n