#963598 ITP: libsonlib -- compact C/Python library for sequence analysis in bioinformatics

#963598#5
Date:
2020-06-24 09:08:03 UTC
From:
To:
Subject: ITP: libsonlib -- compact C/Python library for sequence analysis in bioinformatics
Package: wnpp
Owner: Andreas Tille <tille@debian.org>
Severity: wishlist

* Package name    : libsonlib
  Version         : 1.1+git20200429.1040ab0
  Upstream Author : by Benedict Paten <benedictpaten@gmail.com>
* URL             : https://github.com/ArtRand/sonLib
* License         : MIT
  Programming Lang: C
  Description     : compact C/Python library for sequence analysis in bioinformatics
 SonLib is a small general purpose library for C and Python for sequence
 analysis with focus on bioinformatics.
 .
 For basic data-structures in C it contains:
 .
  * array lists (automatically resizing)
  * hashes
  * sets (backed by hashes)
  * sorted sets (backed by an AVL tree)
  * containers (for putting primitives into the above data-structures)
  * better string functions
  * simple exception mechanism
  * logging functions
 .
 For bioinformatic data-structures it contains:
 .
  * Fasta I/O functions
  * MAF I/O functions
  * Newick tree I/O functions

Remark: This package is maintained by Debian Med Packaging Team at
https://salsa.debian.org/med-team/libsonlib

#963598#12
Date:
2020-07-04 06:02:41 UTC
From:
To:
Hi Shayan,

I tried running sonLibTests under gdb

  $ LC_ALL=C gdb  sonLibTests
  run
  ...
Running test case testJoinCosts_random
Running test case testStPhylogeny_reconcileAtMostBinary_degree2Nodes
Running test case testSimpleNeighborJoin
--Type <RET> for more, q to quit, c to continue without paging--

Thread 1 "sonLibTests" received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x9074) at malloc.c:3102
3102    malloc.c: No such file or directory.


No idea how to continue here.

I also tried the following patch:

index bd92da0..a3d3c78 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,11 +12,11 @@ override_dh_auto_build:
        # Somehow Makefile does not deal with this ...
        #mkdir -p bin
        #cp -a src/sonLib/test/sonLib_daemonize.py .
-       dh_auto_build
+       CGL_DEBUG=ultra dh_auto_build

 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-       dh_auto_test || true
+       CGL_DEBUG=ultra dh_auto_test || true
 endif

 override_dh_install:


which needed debian/patches/fix_warnings.patch but I have no idea how to
fix this build error:

...
gcc -std=c99 -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Werror --pedantic -g -O1 -fno-inline -fno-omit-frame-pointer -fsanitize=address -I/usr/include -DHAVE_TOKYO_CABINET=1     -Iusr/include/quicktree -g -O2 -fdebug-prefix-map=/build/libsonlib-1.1+git20200429.1040ab0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -I inc -I ../lib/ -I/usr/include/quicktree/ -c impl/*.c
impl/sonLibList.c: In function ‘st_list_sortP’:
impl/sonLibList.c:258:13: error: ISO C forbids conversion of object pointer to function pointer type [-Werror=pedantic]
  258 |     return ((int (*)(const void *, const void *))fn)(*((char **)a), *((char **)b));
      |             ^
impl/sonLibList.c: In function ‘stList_sort’:
impl/sonLibList.c:262:76: error: ISO C forbids conversion of function pointer to object pointer type [-Werror=pedantic]
  262 |     sort_r(list->list, stList_length(list), sizeof(void *), st_list_sortP, (void *)cmpFn);
      |                                                                            ^
impl/sonLibList.c: In function ‘st_list_sort2P’:
impl/sonLibList.c:267:56: error: ISO C forbids conversion of object pointer to function pointer type [-Werror=pedantic]
  267 |     int (*cmpFn)(const void *, const void *, void *) = (int (*)(const void *, const void *, void *))(((void **)extra)[0]);
      |                                                        ^
impl/sonLibList.c: In function ‘stList_sort2’:
impl/sonLibList.c:273:24: error: ISO C forbids conversion of function pointer to object pointer type [-Werror=pedantic]
  273 |     void *extra[2] = { (void *)cmpFn, (void *)extraArg };
      |                        ^
cc1: all warnings being treated as errors
make[3]: *** [Makefile:54: ../lib/sonLib.a] Error 1


I think we should try the maximim debug options and try gdb again.

Seems more help is needed here.

Kind regards

      Andreas.