fedora 6 distribution error

After sucessfully installing Panda3D Fedora 6 dist., I tried to execute a tutorial under

This is what I did:

#ppython Tut-Step-1-Blank-Window.py
DirectStart: Starting the game.
Traceback (most recent call last):
  File "Tut-Step-1-Blank-Window.py", line 11, in ?
    import direct.directbase.DirectStart
  File "/usr/share/panda3d/direct/src/directbase/DirectStart.py", line 3, in ?
    from direct.showbase import ShowBase
  File "/usr/share/panda3d/direct/src/showbase/ShowBase.py", line 10, in ?
    from pandac.PandaModules import *
  File "/usr/share/panda3d/pandac/PandaModules.py", line 1, in ?
    from libpandaexpressModules import *
  File "/usr/share/panda3d/pandac/libpandaexpressModules.py", line 1, in ?
    from extension_native_helpers import *
  File "/usr/share/panda3d/pandac/extension_native_helpers.py", line 20, in ?
    from libpandaexpress import *
ImportError: /usr/lib/panda3d/libdtool.so: cannot restore segment prot after reloc: Permission denied

I tried both the root account and an general user account, either of them worked.
I installed panda3D using a root previlege.

This is an SELinux problem. I had forgotten all about this.

I had to disable SELinux to compile panda under Fedora Core 6. Perhaps David could look into this?

Thanks Josh… you are fast!

BTW, do I have to disable SElinux to run panda3D as well?

Looks like it. That’s unfortunate. We should fix that.

I know little to nothing about SELinux, but how can we “fix” a problem in which the OS is denying access to the hardware?


This error message:

“cannot restore segment prot after reloc”

Seems to be a fairly common one associated with applications that load shared objects when using SELinux. I don’t know what it means, but I don’t think it’s related to hardware access. I think it has something to do with some particular DLL usage pattern.

Oh, and I found this interesting tidbit on the web:

this error can result from building code in the
DSO that failed to have the -fpic or -fPIC flag enabled.

That’s interesting. As of the current CVS trunk, we do properly specify -fPIC on every object file built for an .so (it turns out that OSX requires this). I’m not sure whether this fix made it into the 1.3 branch or not.


It would be trivial to integrate -fPIC into makepanda, but then there’s the question of all the thirdparty libraries. I’d have to rebuild those, too. Unfortunately, I don’t have time to do that right now.

There may be a temporary workaround involving the use of “execstack”. I’d greatly appreciate it if you linux gurus out there could try it out and see if you could get such a workaround to function.

Right now my temporary way to get Panda3D working is to disable SElinux.

Here’s how I did it:

The file to modify is: /etc/selinux/config

and set SELINUX=disabled