If you have a fresh installation of Ubuntu, there are a few things you usually need to install before running Neverwinter Nights. You should cd to the nwn folder and run
./fixinstall
(like you will have done when initially installing the game). This will check the game files and make sure you are ready to run the game. It is also worth manually checking that everything is executable that needs to be. (See also the bioware site for a good general tutorial and forum on Neverwinter Nights).
The most important dependency of the game is SDL, as we usually use the system SDL rather than the old, buggy version that comes with the client. So please enter:
sudo apt-get install libsdl1.2debian libsdl-sound1.2 libsdl-mixer1.2 libsdl-net1.2 libsdl-image1.2
You should also make sure you are using the following line in the nwn script in the nwn folder:
export LD_LIBRARY_PATH=./miles:$LD_LIBRARY_PATH
If you are using the movie patch as noted at the Bioware site, you will need to install the dependencies for the BinkPlayer.
sudo apt-get install libstdc++5 libx11-dev
I assume that you have the BinkPlayer executable in the nwn folder and the line
export LD_PRELOAD=./nwmovies.so
in the nwn script in the nwn folder.
If none of these suggestions fixes the problem, please cd to the nwn folder and run:
strace -o nwn.log ./nwn $@
(As you have done, you could also put strace -o nwnmain.log ./nwmain $@ in the nwn script and then run the script with ./nwn.) The resulting log files in your game folder might contain some useful information. As included by you in the comments, the logfiles are nwn.log and nwnmain.log.
After examining your log files and comparing (in particular) your nwnmain.log results to mine, there are some differences (although most of the unimportant errors are common).
- You don't have
open("./nwmovies.so", and all that goes after that, but you may not have applied the movie patch.
- There are many
./lib references in your file and none in mine, so I wonder if there are any errant ./lib references in your nwn script.
- Your file obviously terminates with a
segfault, but I think the main problem is that the libraries cannot be found properly. You can confirm this by going to the nwn folder and running ldd nwmain.
In sum, I should make sure the game is set up properly (as I noted earlier in the answer), look for any errant references to ./lib in your config files, check that your libraries are being loaded properly (and if not perhaps add them to the nwn script with LD_LIBRARY_PATH), and check the permissions on your files are correct so that they will run properly.