Linux Game Development Part 4
Testing
SELinuxSome of the newer distributions, particularly Fedora Core 5 and above, come with SELinux turned on by default. SELinux stands for Security Enhanced Linux, developed by the NSA, which provides a set of Linux Security Modules in the Linux kernel that controls programmatic access to the major subsystems in the kernel. The idea behind SELinux is to address and contain the damage that could be caused by malicious or flawed applications. The problem with SELinux is that when it prevents a game from running, the error messages are usually misleading and give no clue as to the real cause or solution of the problem. For example, this is one of the more common errors that you might see: ./game: error while loading shared libraries: libgame.so: cannot restore segment prot after reloc: Permission deniedThe real problem here is that libgame.so has TEXTRELs, which means the dynamic linker manually relocates it. Apparently, this is not allowed in some SELinux policies. One workaround is to have your testers (and eventually your end users) run the following commands on their SELinux-enabled system after installing your game: cd /path/to/game sudo chcon -t texrel_shlib_t libgame.soThis changes the security permissions for libgame.so to allow TEXTRELs. Of course, this doesn’t actually solve the TEXTREL problem itself, which typically requires quite an effort to track down the offending code and fix. This web site gives detailed instructions about how to find and fix TEXTRELs: http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml. 64-Bit LinuxMost developers will probably produce a 32-bit version of their game, and most of the installer builders listed in the previous article will produce a 32-bit installer. This is great for people using 32-bit Linux distributions. But unless you produce a 64-bit version of your game, here is something you need to watch out for on 64-bit systems. The 64-bit versions of some Linux distributions like Ubuntu do not come with the 32-bit libraries installed by default, which are required in order to run 32-bit programs. If you or a tester is using a 64-bit Linux distribution and the installer and/or game will not run, then you should make sure the 32-bit libraries are installed. For Ubuntu, this means installing the ia32-libs package. SummaryHopefully, now you have a little better idea of how to conduct testing on Linux, and some of the potential problems to watch out for. These tips may also help you troubleshoot common problems that your Linux customers may experience. In our last installment, we’ll talk about how to market and distribute your commercial Linux game. Until next time! The final article in this series is scheduled to be published on 10/15 - Ed.
|