Upcoming Events
Southwest Gaming Expo
11/20 - 11/22 @ Dallas, TX

Workshop on Network and Systems Support for Games (NetGames 2009)
11/23 - 11/25 @ Paris, France

ICIDS 2009 Interactive Storytelling
12/9 - 12/11 @ Guimarães, Portugal

Global Game Jam
1/29 - 1/31  

More events...


Quick Stats
6674 people currently visiting GDNet.
2341 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!



Link to us

Link to us

  Intel sponsors gamedev.net search:   

Linux Game Development Part 4
Testing


SELinux

Some 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 denied
The 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.so
This 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 Linux

Most 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.

Summary

Hopefully, 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.


Contents
  Testing on Multiple Distributions
  Hardware Accelerated Video Drivers
  SELinux & 64-Bit Linux

  Printable version
  Discuss this article

The Series
  Part 1: Introduction
  Part 2: Distributable Binaries
  Part 3: Installers
  Part 4: Testing
  Part 5: Marketing and Distribution