0

I have a system where Python is embedded (C++ System) and that embedded python is further extended with the C++ application itself.

My problems started when I decided to include a new type definition in the Python extension. I get to define a new type using -> https://docs.python.org/2/extending/newtypes.html . But then the application crash (both in C++ and Python [Fatal Python error: UNREF invalid object]).

If I deactivate the lines that connect the python interpreter to the external PyDev debugger everything works just fine but if I activate those the crash appears.

Do you have any idea on this issue?

1 Answer 1

2

Well, apparently this is an issue in your C/C++ code. I believe that the debugger is just exposing an existing bug in your code (i.e.: the debugger will inspect your objects doing a dir() on them and possibly calling repr() or str() -- and probably during this process your object is doing something bad).

My suggestion is compiling your code in debug mode (and generating an _d library) and then running with python in debug (native) mode with python_d.

I.e.: configure python_d inside Eclipse/PyDev, launching your code with python_d and attaching your C/C++ debugger to the running process.

Note that if it's too difficult to have python_d and all dependencies you need in debug mode, there may be some workarounds on to generate a release library with debug information (but the ideal is actually having python and all dlls in debug mode).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.