segmentation fault

IchUndNichtDu

10-02-2013 22:16:39

hey guys!
I installed python-ogre including ois, cegui and bullet few days ago, on Ubuntu12.10 64bit. Now i tested it and see: my program fails in a segmentation fault after loading a texture. On windows the program works fine and on another PC with Ubuntu 12.10 i386 (virtual machine) it works fine too. The Demo_Bezier.py works and fails after ending the program with esc in a segmentation fault. (?) Demo_Shadows.py crash in a segmentation fault too. Can anyone help me?

IchUndNichtDu

22-02-2013 14:17:12

after a little bit trying i found that the segmentation fault happens by the command "fenster.getCustomAttributeInt("WINDOW")" where "fenster" is an instance of ogre.RenderWindow.

dermont

22-02-2013 15:33:58

after a little bit trying i found that the segmentation fault happens by the command "fenster.getCustomAttributeInt("WINDOW")" where "fenster" is an instance of ogre.RenderWindow.

If you are running a 64bit machine then you probably need to use getCustomAttributeUnsignedLong, take a look at sf_OIS.py:


import platform
int64 = False
for bit in platform.architecture():
if '64' in bit:
int64 = True
if int64:
windowHnd = self.renderWindow.getCustomAttributeUnsignedLong("WINDOW")
else:
windowHnd = self.renderWindow.getCustomAttributeInt("WINDOW")


If you need to debug segfaults then install python-dbg and set OIS usage to non exclusive mode (if you don't your system will lock up ), e.g. in sf_OIS.py:

t= self._inputSystemParameters()
params = [("WINDOW",str(windowHnd)), ("x11_mouse_grab","false"), ("x11_mouse_hide", "false"),("x11_keyboard_grab","false")] ## untested
#params = [("WINDOW",str(windowHnd))] ## untested
#params.extend(t)
self.InputManager = OIS.createPythonInputSystem( params )


Then run:
gdb python
(gdb) run <yourprogramname>.py
(gdb) bt
etc.

IchUndNichtDu

22-02-2013 15:51:37

Thanks for the help. Was the 64bit problem.