What's new

Mupen (32 bits) crashes @ x86_64 platform

rcsdnj

New member
Hi,

I have Ubuntu 7.04 64 bits OS installed and I'm trying to run Mupen on this environment. I think I have all the 32 bits libraries correctly installed (gtk, sdl, etc.), Mupen doesn't complain about anyone. But when I try to run a game, Mupen crashes.

It doesn't crash if I turn off the dynamic recompiler (using Interpreter).

I already know that dynamic recompiler needs to be rewritten for the 64 bits platform; but since I'm running the 32 bits version, I have no idea about why is it crashing, since mupen should be running in compatibility mode just like any other 32 bits process.

Any help would be appreciated, I would like to able again to play my games (many games works badly in interpreter mode).
 
OP
R

rcsdnj

New member
Great! It worked!

I wasn't able to disable NX bit protection using the command you gave me, tough. I disabled it in my motherboard's BIOS.

I'll search if there's a way to disable it only for one application (like under Windows), because I would not like to disable it system-widely just because one program. Please, if anyone knows how to do this, post here. I'll do the same if I find how.

Hactarux, do you think this problem is easy to fix for the 32-bit version? Would the 64-bit version have this problem?

Thank you for the attention.
 

Hacktarux

Emulator Developer
Moderator
I don't know how to disable it for one application. I will check how to solve this problem, my main concern is to not break portability to other operating systems.
 

svpe

New member
You can use the execstack tool from the prelink package to disable the NX protection (i.e. making the stack executable) for one application. After running the following command the dynamic recompiler worked for me :)
Code:
execstack -s /usr/games/bin/mupen64_nogui
 
Last edited:

Richard42

Emulator Developer
I also have this problem - on both a Gentoo Athlon64 system and a Core 2 duo mobile running Fedora 8 test 3. I have mupen64 v0.5 and had to modify the makefile to force 32-bit compilation and linking, but the emulator runs with the interpreter or pure interpreter.

I ran it with --emumode 2 on the core 2 duo in a debugger (gdb) and caught the exception. It jumped from a 0x0800xxxx memory address (dyna_start()) to a 0x09f9xxxx address, which was readable but (I guess?) not executable. I disassembled starting at the current program counter from the crash (the 0x09f9 address) and it was 3 instructions repeating over and over making calls to indirect functions. It looked like a state machine.

I have the kernel loaded with 'exec-shield=0' and sysctl shows it to be off, so that kernel feature shouldn't be a problem. I also set the memory protection settings in SELinux to the most permissive. But still it crashes.
 

nmn

Mupen64Plus Dev.
Code:
execstack -s /usr/games/bin/mupen64_nogui
YES!!!

This fixes MY recompiler problem. I installed a libselinux.so.0 rpm, a libelf.so.1 rpm, and Debian's prelink package and the command to get this successfully working. I may release a couple scripts that do this(One for i386 and one for AMD64, and regardless of if you have the necessary files) but the 32bit version of it should be considered dangerous (Though not much wrong it can do as long as you got the right version)

BTW, I grabbed a bunch of random packages for many different Linux distros to do this - proof that dependency hell is beginning to disappear for libraries using proper versioning convention to separate the ABI incompatibility. In fact, i didn't use one native package to do this. (I happen to run Gentoo. Which means normally the exact command would've worked after installing the packages for the official Mupen64 packages, but i build from source so it would be slightly different. I also don't install, so its dramatically different XD)
 

Top