Page 1 of 1

Using Ogre with Cython

Posted: Sun Apr 14, 2019 6:25 pm
by jhwangbo
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/[0x7fe7503c7f20]
[jpc:01026] [ 1] /lib/x86_64-linux-gnu/[0x7fe7503c7e97]
[jpc:01026] [ 2] /lib/x86_64-linux-gnu/[0x7fe7503c9801]
[jpc:01026] [ 3] /lib/x86_64-linux-gnu/[0x7fe750412897]
[jpc:01026] [ 4] /lib/x86_64-linux-gnu/[0x7fe75041990a]
[jpc:01026] [ 5] /lib/x86_64-linux-gnu/[0x7fe750420e1c]
[jpc:01026] [ 6] /home/jemin/workspace/pyraisimgym/lib/ogre-lib/lib/OGRE/[0x7fe6ed7500a7]
[jpc:01026] [ 7] /home/jemin/workspace/pyraisimgym/lib/ogre-lib/lib/OGRE/[0x7fe6ed7474ce]
[jpc:01026] [ 8] /usr/local/lib/[0x7fe74db70b1f]
[jpc:01026] [ 9] /usr/local/lib/[0x7fe74db70dc8]
[jpc:01026] [10] /usr/local/lib/[0x7fe74db713ef]
[jpc:01026] [11] /usr/local/lib/[0x7fe74db7383b]
[jpc:01026] [12] /usr/local/lib/[0x7fe74d629bfc]
[jpc:01026] [13] /usr/local/lib/[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?

Re: Using Ogre with Cython

Posted: Thu May 16, 2019 4:46 am
by jhwangbo
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