Debugging segfault on swig/python/c++
- by Pradyot
I am trying to figure out what the best way to debug a segault with swig/python/c++.
A core file is being generated.
I have a basic MessageFactory(defined in c++ that provides a simple interface to accept a few strings as input and return a string as output).
This interface is then specified in a .i file.
swig is used to generate Wrapper.cpp as well as a MessageFactory.py from the .i file. This along with supporting files is compiled into a dynamic lib.
The point of failure , is when the MessageFactory is instantiated within python code.
Any suggestions on how I can go about debugging this?
I've tried running the script within pdb, what I know from that is import on the generated MessageFactory.py is whats causing the seg-fault.