Bug 2949 - VM problem on openSUSE 10.2 x86
Status: RESOLVED WORKSFORME
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: PC Linux
: P2 major
Assignee: Ludwig Nussel
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2006-12-10 09:07 EST by Joerg Dietrich
Modified: 2007-05-21 11:23:04 EDT
1 user (show)

See Also:



Description Joerg Dietrich 2006-12-10 09:07:34 EST
The release version of ioquake3 doesn't run on openSUSE 10.2 x86 anymore
when you use the qvms instead of the native libraries (*.so).
The native libraries work, a debug compile of ioquake3 works,
the exact same binary copied to another machine with openSUSE 10.0 works.
An old binary compiled on openSUSE 10.1, which worked on openSUSE 10.1
doesn't work anymore after the upgrade to openSUSE 10.2.
So it seems to be a bug triggered by a new version of a shared library
in openSUSE 10.2 x86.
Here is the relevant snipped of the programms output :

Sys_LoadDll(ui) failed dlopen() completely!
Failed to load dll, looking for qvm.
Loading vm file vm/ui.qvm...
...which has vmMagic VM_MAGIC_VER2
Loading 1106 jump table targets
Received signal 11, exiting...
----- CL_Shutdown -----
RE_Shutdown( 1 )
-----------------------

On the 10.0 box it only loads 901 jump table targets.

My amateurish tinkering with gdb resulted in this :

(gdb) where
#0  0xb7d8bc57 in memcpy () from /lib/libc.so.6
#1  0x081829a0 in VM_Compile ()
#2  0x00000000 in ?? ()

Please contact me if you need more info.
Comment 1 Thilo Schulz 2006-12-11 20:07:38 EST
What compiler did you use to compile ioquake3?
I remember a crashbug in ioquake3 when you compiled the sources with gcc 4.0.* series.
Comment 2 Thilo Schulz 2006-12-11 20:10:08 EST
Ah right... it crashes in memcpy... maybe a bit too restrictive kernel security options? You must make sure that ioquake3 can mark memory ranges as executable and then jump into it.
You could also debug printf how much memory it actually allocates and how much memory memcpy() actually copies.
Comment 3 Joerg Dietrich 2006-12-17 15:49:19 EST
OK, I hunted the bug a bit more.
The bug occurs in qcommon/vm_x86.c in function VM_Compile() line 1096 :

Com_Memcpy( vm->codeBase, buf, compiledOfs );

This memcpy() crashes, but the cause of the problem is the mmap() in line 1084. 
If you undefine VM_X86_MMAP and use the normal malloc() instead, 
the programm runs without problems on my Pentium4 without NX.
Comment 4 Ludwig Nussel 2006-12-18 11:28:40 EST
not supposed to happen. the memory is mmap'd W, copied to and then changed to RX.
Comment 5 Thilo Schulz 2006-12-18 16:16:11 EST
I agree. This does not look like a bug in ioquake3 at all.
J
Comment 6 Thilo Schulz 2006-12-18 16:17:16 EST
The bugzilla has swallowed half of my comment. New try:
##

I agree. This does not look like a bug in ioquake3 at all.
J
Comment 7 Thilo Schulz 2006-12-18 16:18:47 EST
Oh it does not accept special characters. Third try:
##

I agree. This does not look like a bug in ioquake3 at all.
Joerg: Can you debug printf the arguments that mmap and memcpy get passed, please?
That's the only thing I could think of that gets wrong if this is a bug in ioquake3.
Comment 8 Ludwig Nussel 2006-12-20 06:19:46 EST
can't reproduce here, neither with NX, no NX, self built nor Thilo's binaries.
Comment 9 Joerg Dietrich 2006-12-20 15:30:44 EST
I installed a fresh openSUSE 10.2 onto a spare harddisk
on the same computer and there ioquake3 works.
So it seems to be a problem with my installation.
Maybe it wasn't a good idea to do an upgrade insteed
of a fresh install.
From my standpoint this "bug" can stay RESOLVED WORKSFORME.
Comment 10 Ryan C. Gordon 2007-05-21 11:23:04 EDT
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.

--ryan.