Skip to content
Martin Albrecht edited this page Jul 15, 2017 · 3 revisions

C++

Backtraces

C++ backraces are currently broken in cysignals, a partial fix is available as a pull request.

Compiling with DEBUG

  1. Build Fplll with debugging enabled

    make clean
    CXXFLAGS="-O0 -ggdb -DDEBUG" ./configure --prefix=$VIRTUAL_ENV --disable-static
    make -j4 install
    
  2. Build Fpylll with debugging enabled

    rm -r build
    CXXFLAGS="-O0 -ggdb  -DDEBUG" python setup.py install
    

GDB

gdb --args python test.py

Valgrind

  1. You may want to download (valgrind-python.supp)[http://svn.python.org/projects/python/trunk/Misc/valgrind-python.supp]

  2. Uncomment the lines for PyObject_Free and PyObject_Realloc, also add variants for 8 bytes:

    {
       ADDRESS_IN_RANGE/Invalid read of size 4
       Memcheck:Addr4
       fun:PyObject_Free
    }
    
    {
       ADDRESS_IN_RANGE/Invalid read of size 4
       Memcheck:Value4
       fun:PyObject_Free
    }
    
    {
       ADDRESS_IN_RANGE/Invalid read of size 8
       Memcheck:Addr8
       fun:PyObject_Free
    }
    
    {
       ADDRESS_IN_RANGE/Invalid read of size 8
       Memcheck:Value8
       fun:PyObject_Free
    }
    
    
    {
       ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
       Memcheck:Cond
       fun:PyObject_Free
    }
    
    {
       ADDRESS_IN_RANGE/Invalid read of size 4
       Memcheck:Addr4
       fun:PyObject_Realloc
    }
    
    {
       ADDRESS_IN_RANGE/Invalid read of size 4
       Memcheck:Value4
       fun:PyObject_Realloc
    }
    
    {
       ADDRESS_IN_RANGE/Invalid read of size 8
       Memcheck:Addr8
       fun:PyObject_Realloc
    }
    
    {
       ADDRESS_IN_RANGE/Invalid read of size 8
       Memcheck:Value8
       fun:PyObject_Realloc
    }
    
    {
       ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
       Memcheck:Cond
       fun:PyObject_Realloc
    }
    
  3. Run valgrind

    valgrind --suppressions=valgrind-python.supp python test.py
    
Clone this wiki locally