Commits

Benjamin Bean authored 35ca20375ad
CAS-13335 slightly more readable example for running casa with valgrind
No tags

readme.md

Modified
111 111 ```
112 112 (gdb) break casa6core::MeasurementSet::MeasurementSet()
113 113 Breakpoint 1 at 0x7ff0d026b010: file casacore/ms/MeasurementSets/MeasurementSet.cc, line 68.
114 114 (gdb) continue
115 115 ```
116 116
117 117 To run casa with valgrind + gdb, start with valgrind with PYTHONMALLOC=malloc, emulate what
118 118 the bin/casa perl script does, and attach gdb with the target command. For example, to start
119 119 casa and look for memory mismanagement:
120 120 ```
121 --bash-4.2$ LITHDIR="casalith/build-casalith/work/linux/output/casa-bbean-6.2.0-9"; EXTPATH="${LITHDIR}/lib/py/bin:${LITHDIR}/lib/casa/bin:${PATH}"
122 --bash-4.2$ PATH="$EXTPATH" PYTHONMALLOC=malloc valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes --log-file=valgrind.log ${LITHDIR}/lib/py/bin/python3 -m casashell --nogui --log2term -c test.py
121 +-bash-4.2$ LITHDIR="casalith/build-casalith/work/linux/output/casa-bbean-6.2.0-9"
122 +-bash-4.2$ EXTPATH="${LITHDIR}/lib/py/bin:${LITHDIR}/lib/casa/bin:${PATH}"
123 +-bash-4.2$ PATH="$EXTPATH" PYTHONMALLOC=malloc valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes \
124 +> --log-file=valgrind.log "${LITHDIR}/lib/py/bin/python3" -m casashell --nogui --log2term -c <yourpythonfile>.py
123 125 ```
124 126 Now in another terminal, attach gdb:
125 127 ```
126 128 -bash-4.2$ PATH="$EXTPATH" gdb "${LITHDIR}/lib/py/bin/python3"
127 129 (gdb) target remote | /usr/bin/vgdb
128 130 (gdb) break casa6core::MeasurementSet::MeasurementSet()
129 131 Breakpoint 1 at 0x7ff0d026b010: file casacore/ms/MeasurementSets/MeasurementSet.cc, line 68.
130 132 (gdb) continue
131 133 ```

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut