Using Ogre with Cython

Problems building or running the engine, queries about how to use features etc.
Post Reply
jhwangbo
Gnoblar
Posts: 10
Joined: Sun Feb 24, 2019 11:27 pm
x 1

Using Ogre with Cython

Post by jhwangbo » Sun Apr 14, 2019 6:25 pm

Ogre Version: 1.11.5
Operating System: Ubuntu 18.04
Render System: Opengl3+

I am trying to launch my ogre app from python using cython. but I get the following error

Code: Select all

free(): invalid pointer
[jpc:01026] *** Process received signal ***
[jpc:01026] Signal: Aborted (6)
[jpc:01026] Signal code:  (-6)
[jpc:01026] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7fe7503c7f20]
[jpc:01026] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7fe7503c7e97]
[jpc:01026] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7fe7503c9801]
[jpc:01026] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x89897)[0x7fe750412897]
[jpc:01026] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x9090a)[0x7fe75041990a]
[jpc:01026] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4cc)[0x7fe750420e1c]
[jpc:01026] [ 6] /home/jemin/workspace/pyraisimgym/lib/ogre-lib/lib/OGRE/RenderSystem_GL3Plus.so.1.11.5(_ZN4Ogre19GL3PlusRenderSystemC1Ev+0x1f7)[0x7fe6ed7500a7]
[jpc:01026] [ 7] /home/jemin/workspace/pyraisimgym/lib/ogre-lib/lib/OGRE/RenderSystem_GL3Plus.so.1.11.5(+0x584ce)[0x7fe6ed7474ce]
[jpc:01026] [ 8] /usr/local/lib/libOgreMain.so.1.11.5(_ZN4Ogre4Root13installPluginEPNS_6PluginE+0xff)[0x7fe74db70b1f]
[jpc:01026] [ 9] /usr/local/lib/libOgreMain.so.1.11.5(_ZN4Ogre4Root10loadPluginERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x188)[0x7fe74db70dc8]
[jpc:01026] [10] /usr/local/lib/libOgreMain.so.1.11.5(_ZN4Ogre4Root11loadPluginsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x50f)[0x7fe74db713ef]
[jpc:01026] [11] /usr/local/lib/libOgreMain.so.1.11.5(_ZN4Ogre4RootC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_S8_+0x14eb)[0x7fe74db7383b]
[jpc:01026] [12] /usr/local/lib/libOgreBites.so.1.11.5(_ZN9OgreBites18ApplicationContext10createRootEv+0x6dc)[0x7fe74d629bfc]
[jpc:01026] [13] /usr/local/lib/libOgreBites.so.1.11.5(_ZN9OgreBites18ApplicationContext7initAppEv+0xf)[0x7fe74d62a0df]
Here I am only loading Opengl3+ plugin and disabled all others. As it states above, the error is from the constructor of "GL3PlusRenderSystem". Although I am not 100% sure, I think the error is from "xFree()" in the constructor of "GLXGLSupport::GLXGLSupport". Cython is basically just calling a function in CPP, and this function runs well if I just compile the cpp code. Cython code also runs well if I remove the ogre part.

Is there any x11 or opengl issue when they are called from python/cython?
0 x

jhwangbo
Gnoblar
Posts: 10
Joined: Sun Feb 24, 2019 11:27 pm
x 1

Re: Using Ogre with Cython

Post by jhwangbo » Thu May 16, 2019 4:46 am

Finally found a workaround. Don't use cython... Pybind11 solved the problem. It also solved many other problems as well and the code is simpler too
1 x

Post Reply