[Nauty] memory leaks in nauty

Mathieu Dutour mathieu.dutour at gmail.com
Fri Nov 13 02:57:44 AEDT 2020


Dear all,

I am looking for using the nauty for intensive computation and
I would like to avoid any memory problems while it runs.

I use valgrind for detecting memory leaks which is pretty efficient
for C programs.

The first thing is that the test program lack some memory deallocation
statements. E.g. for nautyex7.c the following is missing:
-----
    DYNFREE(lab1,lab1_sz);
    DYNFREE(lab2,lab2_sz);
    DYNFREE(ptn,ptn_sz);
    DYNFREE(orbits,orbits_sz);
    DYNFREE(map,map_sz);
    SG_FREE(sg1); SG_FREE(sg2);
    SG_FREE(cg1); SG_FREE(cg2);
-----
This is maybe some boring stuff but I think good example are useful.

After cleanup of above error the following more serious problem shows
up:
==2073== 16 bytes in 1 blocks are still reachable in loss record 1 of 1
==2073==    at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2073==    by 0x167C39: preparemarks1 (nausparse.c:125)
==2073==    by 0x167C39: updatecan_tr (nausparse.c:488)
==2073==    by 0x1588C0: Traces (traces.c:1246)
==2073==    by 0x109991: main (nautyex7.c:103)

Best wishes,

  Mathieu


More information about the Nauty mailing list