Segfaults and Debugging with Python Bindings

Problems building or running the engine, queries about how to use features etc.
Post Reply
jlm
Gnoblar
Posts: 7
Joined: Fri Aug 16, 2019 10:17 pm

Segfaults and Debugging with Python Bindings

Post by jlm »

Ogre Version: 1.12
Operating System: Ubuntu 18.04

I'm trying to set up my first basic scene using Ogre with Python bindings. I make a scene manager and create a light and add that light to a node in the scene manager. Then, I try to make a camera, but when I run the line

Code: Select all

cam = scene_manager.createCamera("Camera")
I get a segfault. My question here is twofold:

1) Does anyone have ideas on what might be causing this?
2) Is there some way I can get a more detailed error output for debugging, given that I'm using the Python bindings for Ogre?

Thanks in advance!
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Segfaults and Debugging with Python Bindings

Post by paroj »

1. try to follow the upstream sample: https://github.com/OGRECave/ogre/blob/m ... _sample.py
2. make sure that you keep a reference to the objects you need. Passing things to ogre, does not increment their reference count. (use after free)
3. to get a stacktrace, start with gdb as

Code: Select all

gdb --args python3 yourcode.py
Post Reply